feat: Require components to opt out of auto release calculation#100
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an explicit component-level setting to control whether azldev auto-manages RPM Release, and updates release bumping logic/tests/docs to require an explicit opt-out for non-standard Release values.
Changes:
- Introduces
release-calculation(auto|manual) in component config + schema/docs. - Updates release bumping behavior to no-op for
manualand to error on non-standardReleaseunderauto. - Adjusts/extends tests and schema snapshots to cover the new behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/azldev.schema.json | Adds release-calculation property to generated schema. |
| scenario/snapshots/TestSnapshots_config_generate-schema_stdout_1.snap | Updates schema snapshot output for new field. |
| scenario/snapshots/TestSnapshotsContainer_config_generate-schema_stdout_1.snap | Updates schema snapshot output for new field. |
| internal/projectconfig/component.go | Adds ReleaseCalculation type/field + validation/schema tags; copies field in path normalization. |
| internal/projectconfig/component_test.go | Adds validation-focused test for ReleaseCalculation. |
| internal/app/azldev/core/sources/release.go | Switches opt-out mechanism to release-calculation=manual; updates error messaging. |
| internal/app/azldev/core/sources/release_test.go | Removes HasUserReleaseOverlay tests (function removed). |
| internal/app/azldev/core/sources/release_internal_test.go | Adds internal tests for bump behavior across manual/auto/non-standard releases. |
| internal/app/azldev/core/components/resolver.go | Defaults empty ReleaseCalculation to auto during component creation. |
| internal/app/azldev/core/components/resolver_test.go | Updates resolver tests to set ReleaseCalculation explicitly. |
| docs/user/reference/config/components.md | Documents the new release-calculation setting. |
| "enum": [ | ||
| "auto", | ||
| "manual" | ||
| ], |
There was a problem hiding this comment.
The description claims “Empty or omitted means auto,” but the schema doesn’t express a default. Adding "default": "auto" would make the behavior discoverable to schema-driven tooling (editors, generators) and align the schema with the stated semantics.
| ], | |
| ], | |
| "default": "auto", |
| if componentConfig.ReleaseCalculation == "" { | ||
| componentConfig.ReleaseCalculation = projectconfig.ReleaseCalculationAuto | ||
| } |
There was a problem hiding this comment.
This mutates the caller-owned *componentconfig.ComponentConfig in-place. If the same struct pointer is reused elsewhere (e.g., cached config maps, shared test fixtures), this can introduce hard-to-track side effects. Prefer defaulting on a local copy before storing it in the resolved component (e.g., copy the struct, set defaults on the copy, and keep the input immutable).
reubeno
left a comment
There was a problem hiding this comment.
I've got one question regarding extensibility of the config .. but otherwise, changes look good to me. I'll let you triage the copilot feedback to see what's relevant.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Instead of failing unexpectedly, force all packages to either use auto release, or explicitly opt out of it.