Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
fix(WorkItemFilters): Support multiple workItem filters (#1429)
Browse files Browse the repository at this point in the history
* Fix multiple workItem filters spread out the filters before pushing

* fix: apply codefactor suggestion

* fix(release): apply codefactor suggestion

---------

Co-authored-by: Azlam <[email protected]>
  • Loading branch information
brandonmikeska and azlam-abdulsalam authored Oct 24, 2023
1 parent a094576 commit ede7266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/sfpowerscripts-cli/src/impl/release/ReleaseImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export default class ReleaseImpl {
for (const releaseDefinition of this.props.releaseDefinitions) {
releaseName = releaseName.concat(releaseDefinition.release, '-');
if (releaseDefinition.changelog) {
workitemFilters.push(releaseDefinition.changelog?.workItemFilters);
if(releaseDefinition.changelog.workItemFilters) {
workitemFilters.push(...releaseDefinition.changelog?.workItemFilters);
}
if (releaseDefinition.changelog.limit > limit) limit = releaseDefinition.changelog.limit;
workItemUrl = releaseDefinition.changelog.workItemUrl;
showAllArtifacts = releaseDefinition.changelog.showAllArtifacts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Given a WorkItemUpdater', () => {
const resourceDir: string = path.join(__dirname, 'resources');

it('should update latestRelease with work items', () => {
new WorkItemUpdater(latestRelease, ['NGV-[0-9]{3,4}']).update();
new WorkItemUpdater(latestRelease, ['NGV-[0-9]{3,4}', 'TEST-[0-9]{3,4}']).update();

expect(latestRelease).toEqual(
fs.readJSONSync(
Expand Down

0 comments on commit ede7266

Please sign in to comment.