[#73373] Background job for migrating pre-existing data to semantic identifiers#22566
Closed
[#73373] Background job for migrating pre-existing data to semantic identifiers#22566
Conversation
…convert-to-wp-semantic-ids
judithroth
reviewed
Apr 8, 2026
Contributor
judithroth
left a comment
There was a problem hiding this comment.
This is coming along nicely! I'm sorry I found another edge case that keeps me from approving 😅
thykel
commented
Apr 12, 2026
akabiru
reviewed
Apr 13, 2026
This reverts commit 7520e92.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
app/models/work_package/semantic_identifier.rb:103
- The removal of
privatemakesalias_rows_for_sequence_numbera public instance method onWorkPackage, which looks like an internal helper used only byallocate_and_register_semantic_id. Consider restoringprivate(or marking just this method private) to avoid accidentally expanding the public API surface.
# Builds alias rows for every identifier this project has ever used at the given sequence (including the current one).
# This also includes "ghost identifiers" -- i.e. those that weren't ever actually generated, but should work
# as a historical alias (e.g. OLDPROJ-42 should work even if WP #42 was created after rename to NEWPROJ)
def alias_rows_for_sequence_number(seq)
project.slugs
.pluck(:slug)
.map { |prefix| { identifier: "#{prefix}-#{seq}", work_package_id: id } }
end
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
https://community.openproject.org/projects/communicator-stream/work_packages/71645/activity
What are you trying to accomplish?
Add a background procedure to convert project & work package identifiers from
classic(projectcool_project, WP1) tosemantic(projectCP, WPCP-1).The procedure is invoked by switching to the semantic ("alphanumeric") identifier format via the admin settings.
Screenshots
What approach did you choose and why?
The original noop background job is now replaced by
ProjectIdentifiers::ConvertInstanceToSemanticIdsJob. This is the flow:semantic.ProjectIdentifiers::ConvertInstanceToSemanticIdsJobproj=>PROJ), simply set the the identifier mode tosemanticand exit with success. Otherwise, continue further.ProjectIdentifiers::BackfillProjectJob)Additionally, tweak the interface of the admin setting controller to have some proper shape -- previously it required presence of settings hash + a separate
confirm_dangerous_actionparam, now it only needs a properly set settings hash.Merge checklist