AZ-400 Question 103
Select 2Your DevOps team manages several internal libraries that are currently versioned using Semantic Versioning (SemVer). However, you are introducing a new, more frequent release cycle aligned with monthly sprints and plan to move to a date-based versioning (CalVer) scheme. You must also ensure that any backward-incompatible changes are easily identifiable to consumers of these libraries. Which two approaches should you adopt to achieve these goals?
- A
Adopt CalVer but discontinue SemVer increments, even when introducing breaking changes.
- B
Adopt a hybrid approach: apply date-based tags for monthly releases and maintain SemVer rules for indicating compatibility.
- C
Overwrite existing packages in your artifact repository to unify version numbering with the new CalVer approach.
- D
Keep both the date-based label and increment the major version if changes break compatibility or require a migration path.
Show answer and explanation
Correct answers: B, D
Explanation
When migrating to a date-based versioning strategy (CalVer), it is best practice to still follow SemVer guidelines for changes that affect compatibility. This ensures that new releases are easily tracked by date, while major version increments clearly indicate when consumers must prepare for potential code changes. Refer to official documentation on Semantic Versioning (semver.org) and Microsoft DevOps best practices to learn more about combining these approaches effectively.
- A. Incorrect.
Option 1 is incorrect. Completely abandoning SemVer increments means you lose clear signaling of backward-incompatible changes, which can confuse consumers about when they must adjust their code.
- B. Correct.
Option 2 is correct. Many teams use a hybrid strategy: the date-based version conveys the release timestamp, while SemVer rules ensure clarity on whether an update introduces breaking changes or bug fixes.
- C. Incorrect.
Option 3 is incorrect. Overwriting existing packages undermines traceability and can break existing builds that rely on previously acquired packages.
- D. Correct.
Option 4 is correct. Even when employing CalVer for release cadence, you should still bump the major version to indicate breaking changes, which is essential to maintain compatibility awareness for your consumers.