Skip to content

Commit

Permalink
refactor: Refactor mapper.ts in zowe-cli-id-federation (#3772)
Browse files Browse the repository at this point in the history
* refactor mapper.ts

Signed-off-by: sj895092 <shobhackm9@gmail.com>

* Update Mapper.ts

Signed-off-by: ShobhaJayanna <36433611+Shobhajayanna@users.noreply.github.com>

* updating actions/upload-artifact v2 to v3

Signed-off-by: sj895092 <shobhackm9@gmail.com>

---------

Signed-off-by: sj895092 <shobhackm9@gmail.com>
Signed-off-by: ShobhaJayanna <36433611+Shobhajayanna@users.noreply.github.com>
  • Loading branch information
Shobhajayanna authored Sep 17, 2024
1 parent b19ad07 commit 19e3dd5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ErrorMessage-${{ env.JOB_ID }}
path: |
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
java -jar ./scripts/jacococli.jar dump --address cloud-gateway-service --port 6310 --destfile ./results/cloud-gateway-service.exec
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CloudGatewayProxy-${{ env.JOB_ID }}
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
java -jar ./scripts/jacococli.jar dump --address cloud-gateway-service --port 6310 --destfile ./results/cloud-gateway-service.exec
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CloudGatewayServiceRouting-${{ env.JOB_ID }}
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
java -jar ./scripts/jacococli.jar dump --address cloud-gateway-service --port 6310 --destfile ./results/cloud-gateway-service.exec
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CloudGatewayCentralRegistry-${{ env.JOB_ID }}
Expand Down Expand Up @@ -352,7 +352,7 @@ jobs:
# Coverage results are not stored in this job as it would not provide much additional data

- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ContainerCITestsRegistration-${{ env.JOB_ID }}
Expand Down Expand Up @@ -535,7 +535,7 @@ jobs:
-Partifactory_user=${{ secrets.ARTIFACTORY_USERNAME }} -Partifactory_password=${{ secrets.ARTIFACTORY_PASSWORD }}
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITestsZosmfPH34201-${{ env.JOB_ID }}
Expand Down Expand Up @@ -587,7 +587,7 @@ jobs:
-Partifactory_user=${{ secrets.ARTIFACTORY_USERNAME }} -Partifactory_password=${{ secrets.ARTIFACTORY_PASSWORD }}
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ContainerCITestsZosmfWithoutJwt-${{ env.JOB_ID }}
Expand Down Expand Up @@ -640,7 +640,7 @@ jobs:
-Partifactory_user=${{ secrets.ARTIFACTORY_USERNAME }} -Partifactory_password=${{ secrets.ARTIFACTORY_PASSWORD }}
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ContainerCITestsZosmfWithoutJwtWithAuthenticateEndpoint-${{ env.JOB_ID }}
Expand Down Expand Up @@ -696,7 +696,7 @@ jobs:
if: always()

- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ContainerCITestsInternalPort-${{ env.JOB_ID }}
Expand Down Expand Up @@ -759,7 +759,7 @@ jobs:

# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ContainerCITestsWithRedisReplica-${{ env.JOB_ID }}
Expand Down Expand Up @@ -827,7 +827,7 @@ jobs:

# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ContainerCITestsWithRedisSentinel-${{ env.JOB_ID }}
Expand Down Expand Up @@ -907,7 +907,7 @@ jobs:
chmod 755 -R .gradle
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITestsHA-${{ env.JOB_ID }}
Expand Down Expand Up @@ -1002,7 +1002,7 @@ jobs:
chmod 755 -R .gradle
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: LbHaTests-${{ env.JOB_ID }}
Expand Down Expand Up @@ -1072,7 +1072,7 @@ jobs:
chmod 755 -R .gradle
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITestsDiscoveryChaoticHA-${{ env.JOB_ID }}
Expand Down Expand Up @@ -1142,7 +1142,7 @@ jobs:
chmod 755 -R .gradle
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITestsGatewayChaoticHA-${{ env.JOB_ID }}
Expand Down Expand Up @@ -1216,7 +1216,7 @@ jobs:
chmod 755 -R .gradle
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITestsDiscoverableClientChaoticHA-${{ env.JOB_ID }}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ jobs:
chmod 755 -R .gradle
# Coverage results are not stored in this job as it would not provide much additional data
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITestsWebSocketChaoticHA-${{ env.JOB_ID }}
Expand Down Expand Up @@ -1459,13 +1459,13 @@ jobs:
cd metrics-service-ui/frontend
npm run cy:e2e:ci
- name: Upload screenshots API Catalog
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-snapshots
path: api-catalog-ui/frontend/cypress/screenshots
- name: Upload screenshots Metrics service
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-snapshots
Expand Down Expand Up @@ -1508,7 +1508,7 @@ jobs:
-Partifactory_user=${{ secrets.ARTIFACTORY_USERNAME }} -Partifactory_password=${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITestsServicePrefixReplacer-${{ env.JOB_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/service-registration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: >
./gradlew runStartUpCheck --info --scan
- name: Store results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: CITests-${{ env.JOB_ID }}
Expand Down
15 changes: 4 additions & 11 deletions zowe-cli-id-federation-plugin/src/api/Mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,16 @@ export class Mapper {
}

createSafCommands(identities: IIdentity[]): string[] {
let commandProcessor;

switch (this.esm.toLowerCase()) {
case "racf": {
commandProcessor = new RacfCommands(this.registry, identities, this.response);
break;
return new RacfCommands(this.registry, identities, this.response).getCommands();
}
case "tss": {
commandProcessor = new TssCommands(this.registry, identities, this.response);
break;
return new TssCommands(this.registry, identities, this.response).getCommands();
}
case "acf2": {
commandProcessor = new Acf2Commands(this.registry, identities, this.response);
break;
return new Acf2Commands(this.registry, identities, this.response).getCommands();
}
default: {
this.response.data.setExitCode(Constants.FATAL_CODE);
Expand All @@ -75,9 +72,5 @@ export class Mapper {
throw new ImperativeError({msg});
}
}

return commandProcessor ? commandProcessor.getCommands() : [];
}


}

0 comments on commit 19e3dd5

Please sign in to comment.