Split CI/CD-related infrastructure into its own model #15002
Open
dogboat wants to merge 27 commits into
Open
Conversation
valentijnscholten
left a comment
Member
There was a problem hiding this comment.
This looks OK at first sight. Some thoughts:
dojo/models.pyalso contains some logic aroundscm_type, mainly to construct urls to commits. Should this be harmonized/included here as well? Maybe in a follow-up PR?- The
engagementAPI changes should probably be mentioned in the upgrade notes. According to Mr Claude:
Breaking API change: Engagement cicd server fields
EngagementSerializer uses exclude = ("inherited_tags",), so it auto-reflects model fields. This PR removes the old engagement FKs and adds new ones, changing the Engagement payload in a backward-incompatible way:
| Before | After |
|---|---|
build_server |
cicd_build_server |
source_code_management_server |
cicd_scm_server |
orchestration_engine |
cicd_orchestration_engine |
Three things break for existing clients:
- Field names renamed → old keys rejected as unknown / absent on read.
- Target model changed: values were
Tool_ConfigurationIDs, nowCICDInfrastructureIDs — same integer, different object. A client that hardcoded a tool-config ID now points at the wrong row or a non-existent one. - Validation: new FKs use
limit_choices_to={"infrastructure_type": ...}, so posting acicd_build_serverID whose type isn'tbuild_serveris rejected — a new constraint that didn't exist before.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR splits CI/CD-related infrastructure (scm/build/orchestration servers) out of the Tool_Configuration model into its own CICDInfrastructure model. Engagements are updated with new fields to point to the new model; the old fields are dropped.
The migration creates CICDInfrastructure objects from existing Tool_Configuration models used by engagements and populates the new fields on each engagement accordingly.
[sc-12921]