Commit d04c216
feat: Get-BCArtifactUrl - Add Support for -before and -after Parameters in NextMinor and NextMajor (#4075)
## Description
This pull request introduces enhanced handling of the `-before` and
`-after` parameters when using the `-select NextMinor` or `-select
NextMajor` options in the `Get-BCArtifactUrl` cmdlet. Previously, these
parameters were not considered when filtering artifact URLs for
NextMinor or NextMajor versions.
## Motivation
In our Azure DevOps pipelines—using ALOps—we often need to create
containers based on `NextMinor` or `NextMajor` builds. Sometimes,
multiple new builds are released on the same day, which can result in
pipelines retrieving the latest build of today rather than the last
stable build from the day before. This is not inherently problematic,
but it can increase pipeline runtimes and introduce instability if
today's docker container builds are frequently refreshed.
By supporting the `-before` and `-after` parameters in conjunction with
`-select NextMinor` and `-select NextMajor`, we can exclude today's
latest build if necessary, and reliably fetch the last build from
yesterday or a specified date range. This change should significantly
improve pipeline performance and reliability.
## Example Usage
```powershell
Get-BCArtifactUrl -accept_insiderEula -before 2025-12-18 -country de -select NextMinor -type Sandbox
```
This command will fetch the last `NextMinor` build before 2025-12-18 for
Germany (`de`), allowing pipelines to intentionally skip today’s builds
and use the previous stable release.
## Summary of Changes
- Updated logic to consider `-before` and `-after` with `-select
NextMinor`/`NextMajor`
- Improved filtering of builds to support date-based
exclusions/inclusions
## Benefits
- More control over artifact selection in automated pipelines
- Reduces unnecessary container creation and pipeline runtime
- Increases reliability by allowing exclusion of freshly published
builds when needed
- Over the years, this reduces energy consumption (less build agents
needed) and helps reduce the environment impact.
---------
Co-authored-by: Daniel Goehler <[email protected]>1 parent 66ef535 commit d04c216
2 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
120 | 133 | | |
121 | 134 | | |
122 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments