Skip to content

Commit

Permalink
Bugfix for build creation without default parameter value (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryserbin authored Dec 5, 2024
1 parent fdba8b4 commit 6ad0e4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
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

0 comments on commit 6ad0e4a

Please sign in to comment.