Skip to content

[OP-19930] Fix lost seeded custom styles when seeding multiple - #24713

Merged
oliverguenther merged 4 commits into
release/17.7from
fix/seed-remote-asset-job-verbosity
Aug 12, 2026
Merged

[OP-19930] Fix lost seeded custom styles when seeding multiple#24713
oliverguenther merged 4 commits into
release/17.7from
fix/seed-remote-asset-job-verbosity

Conversation

@oliverguenther

@oliverguenther oliverguenther commented Aug 12, 2026

Copy link
Copy Markdown
Member

We suspect something is being discarded without proper logging in the seed design background job. Adds more error logging and retrying for HTTP errors

https://community.openproject.org/work_packages/OP-19930

Comment thread app/workers/custom_styles/seed_remote_asset_job.rb
Comment thread app/workers/custom_styles/seed_remote_asset_job.rb Outdated
@oliverguenther
oliverguenther force-pushed the fix/seed-remote-asset-job-verbosity branch from 1a806fe to 3f149cb Compare August 12, 2026 07:50
Comment thread app/workers/custom_styles/seed_remote_asset_job.rb
@oliverguenther

Copy link
Copy Markdown
Member Author

Thanks @NobodysNightmare , I changed the order and while doing more tests on the newly deployed cluster, I found the underlying issue:

CarrierWave only uploads in an after_commit commit, and with the change to the job, we save the CustomStyle multiple times in a background job. Rails runs only ONE callback of these saves (the last one), so while the DB looks like all files were uploaded, only one of the files are being updated. I think we just tested with one file locally, so this was not found before 🫠

Seeding custom design assets from URLs looked as if they were successful (DB was saved with the file name),
but the files never made it into fog due to carrierwave having an after_commit hook for storing the file.

We update the CustomStyle wiwth save! once per job, and only one of these saves wins the after_commit hook.
This matches what we see on the opendesk env. Files are saved in DB, but are not actually present
@oliverguenther
oliverguenther force-pushed the fix/seed-remote-asset-job-verbosity branch from ccdd738 to 4d9fe3c Compare August 12, 2026 12:12
@oliverguenther oliverguenther changed the title Increase verbosity of remote asset job [OP-19930] Increase verbosity of remote asset job Aug 12, 2026
@oliverguenther oliverguenther changed the title [OP-19930] Increase verbosity of remote asset job [OP-19930] Fix lost seeded custom styles when seeding multiple Aug 12, 2026
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/activities/work_package/activities_spec.rb[1:5:2:1]
  • rspec ./spec/features/projects/lists/filters_spec.rb[1:6:1]
🤖 Ask Copilot to investigate

Copy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer.

@copilot The following spec(s) are flaky in CI (first seen on PR #24713, linked for reference only):

- `rspec ./spec/features/activities/work_package/activities_spec.rb[1:5:2:1]`
- `rspec ./spec/features/projects/lists/filters_spec.rb[1:6:1]`

Treat this as a standalone task, unrelated to PR #24713. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #24713 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @oliverguenther to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @oliverguenther, and request a review from @oliverguenther.
On every commit, set @oliverguenther as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

Comment thread app/workers/custom_styles/seed_remote_asset_job.rb Outdated

@NobodysNightmare NobodysNightmare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the detailed explanations

@oliverguenther
oliverguenther merged commit a00961c into release/17.7 Aug 12, 2026
14 checks passed
@oliverguenther
oliverguenther deleted the fix/seed-remote-asset-job-verbosity branch August 12, 2026 13:33
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants