Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for build creation without default parameter value #113

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Update tasks to use Node 20.1 ([110](https://github.com/dmitryserbin/azdev-release-orchestrator/pull/110))
- Update dependencies ([110](https://github.com/dmitryserbin/azdev-release-orchestrator/pull/110))
- Bugfix creating a build without default parameter value ([113](https://github.com/dmitryserbin/azdev-release-orchestrator/pull/113))

## 3.1.*

Expand Down Expand Up @@ -75,8 +76,6 @@
- Add release variables support ([24](https://github.com/dmitryserbin/azdev-release-orchestrator/issues/24))
- Make approval retries configurable ([23](https://github.com/dmitryserbin/azdev-release-orchestrator/issues/23))

---

## 1.2.*

`2020-08-10`
Expand Down Expand Up @@ -124,8 +123,6 @@
- Improve default endpoint support
- Increase retry & timeout

---

## 1.1.*

`2019-03-11`
Expand All @@ -141,7 +138,7 @@
`2019-02-18`

- Improve ignoreFailure logic
- Minor improvements & bug fixes
- Minor improvements & bugfixes

`2019-02-15`

Expand All @@ -154,12 +151,10 @@
`2019-01-24`

- Added latest release strategy ([#1](https://github.com/dmitryserbin/azdev-release-orchestrator/issues/1))
- Major code refactor and minor bug fixes
- Major code refactor and minor bugfixes
- Addressed intermittent ECONNRESET issue
- Added unit and integration tests

---

## 1.0.*

`2018-12-19`
Expand Down
8 changes: 5 additions & 3 deletions tasks/OrchestratorV3/helpers/buildselector/buildselector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class BuildSelector implements IBuildSelector {
}

if (parameters && Object.keys(parameters).length) {
const definitionParameters: string[] = await this.getParameters(definition, resourcesFilter.repositories.self)
const definitionParameters: string[] = await this.getParameters(definition, resourcesFilter.repositories.self, parameters)

await this.confirmParameters(definition, definitionParameters, parameters)

Expand Down Expand Up @@ -244,14 +244,16 @@ export class BuildSelector implements IBuildSelector {
return stagesToSkip
}

private async getParameters(definition: BuildDefinition, repository?: IRepositoryFilter): Promise<string[]> {
private async getParameters(definition: BuildDefinition, repository?: IRepositoryFilter, buildParameters?: IBuildParameters): Promise<string[]> {
const debug = this.debugLogger.extend(this.getParameters.name)

const result: any = await this.buildWebApi.getRunParameters(definition, repository)
const result: any = await this.buildWebApi.getRunParameters(definition, repository, buildParameters)

const templateParameters: unknown[] = result.templateParameters

if (!Array.isArray(templateParameters) || !templateParameters.length) {
debug(result)

throw new Error(`Unable to detect <${definition.name}> (${definition.id}) definition template parameters`)
}

Expand Down
Loading