fix(core): handle owners and conformance project refs on move/remove#34815
Conversation
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 3518626
☁️ Nx Cloud last updated this comment at |
ac82355 to
028acf8
Compare
1671b1a to
b751692
Compare
37fa17a to
b1ef800
Compare
| "required": ["rules"], | ||
| "additionalProperties": false | ||
| }, | ||
| "owners": { |
There was a problem hiding this comment.
add missing owners schema definition
| // Remove project from conformance rules | ||
| if (removeProjectFromConformanceRules(nxJson, schema.projectName)) { | ||
| nxJsonChanged = true; | ||
| } | ||
|
|
||
| // Remove project from owners patterns | ||
| if (removeProjectFromOwnersPatterns(nxJson, schema.projectName)) { | ||
| nxJsonChanged = true; | ||
| } |
There was a problem hiding this comment.
make sure to remove projects referenced in conformance & owners configs
b1ef800 to
b057580
Compare
419ff09 to
e084e93
Compare
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
When removing a project, also strip exact project name matches from `conformance.rules[].projects` and `owners.patterns[].projects` in nx.json so stale references don't linger. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the owners configuration object to nx-schema.json matching the docs (format, outputPath, patterns, GitLab sections). Also update the remove generator to filter project refs from section-level patterns and handle the `owners: true` shorthand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When removing a project clears all projects from a conformance rule or owners pattern, remove the entire entry rather than leaving an empty projects array. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: barbados-clemens <barbados-clemens@users.noreply.github.com>
…plice Replace nested filter callbacks with a reverse for-loop that splices empty entries in place, making the control flow easier to follow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fef6afc to
3518626
Compare
…34815) ## Current Behavior When removing or moving a project in an Nx workspace, the `owners` and `conformance` sections in `nx.json` are not updated. This leaves stale project references in: - `conformance.rules[].projects` (both plain strings and `{ matcher }` objects) - `owners.patterns[].projects` (top-level and section-level for GitLab) ## Expected Behavior - **On project removal**: Strip the removed project from all conformance rules and owners patterns. Remove entries that become empty after cleanup (rules with no projects, patterns with no projects). - **On project move/rename**: Rename all references to the old project name with the new name in conformance rules and owners patterns (including section-level patterns for GitLab-style CODEOWNERS). - **Schema**: Add `owners` configuration schema to `nx-schema.json` for validation and IDE support, including sections (GitLab CODEOWNERS). ## Related Issue(s) <!-- No specific issue linked --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com> Co-authored-by: barbados-clemens <barbados-clemens@users.noreply.github.com> (cherry picked from commit f6692fc)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
When removing or moving a project in an Nx workspace, the
ownersandconformancesections innx.jsonare not updated. This leaves stale project references in:conformance.rules[].projects(both plain strings and{ matcher }objects)owners.patterns[].projects(top-level and section-level for GitLab)Expected Behavior
ownersconfiguration schema tonx-schema.jsonfor validation and IDE support, including sections (GitLab CODEOWNERS).Related Issue(s)
🤖 Generated with Claude Code