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

ACNA-3231 | E2e tests failure #815

Closed
wants to merge 15 commits into from
Closed

Conversation

amulyakashyap09
Copy link
Contributor

Description

  • a scenario where user does not have login but deployment creds
  • if Audit service is unavailable then deploy/undeploy was failing

Related Issue

ACNA-3231

Motivation and Context

How Has This Been Tested?

  • Tested locally
  • Unit Tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ad8192a) to head (9a61a57).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #815   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           57        57           
  Lines         3332      3326    -6     
  Branches       643       643           
=========================================
- Hits          3332      3326    -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

src/lib/app-helper.js Outdated Show resolved Hide resolved
src/lib/audit-logger.js Outdated Show resolved Hide resolved
src/commands/app/deploy.js Outdated Show resolved Hide resolved
src/commands/app/deploy.js Outdated Show resolved Hide resolved
src/commands/app/deploy.js Outdated Show resolved Hide resolved
src/commands/app/undeploy.js Outdated Show resolved Hide resolved
src/commands/app/undeploy.js Outdated Show resolved Hide resolved
src/commands/app/undeploy.js Outdated Show resolved Hide resolved
test/commands/app/undeploy.test.js Outdated Show resolved Hide resolved
test/commands/lib/audit-logger.test.js Outdated Show resolved Hide resolved
Copy link
Member

@purplecabbage purplecabbage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip all this findCommand, execa call command work, it is not required, just use aioConfig directly as is already done throughout the code.

src/lib/app-helper.js Outdated Show resolved Hide resolved
src/lib/audit-logger.js Show resolved Hide resolved
test/commands/app/deploy.test.js Outdated Show resolved Hide resolved
Copy link
Member

@purplecabbage purplecabbage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation is fine, just had a few questions about the actual way we communicate with our users.

src/commands/app/deploy.js Outdated Show resolved Hide resolved
*/
const checkifAccessTokenExists = async () => {
try {
const token = aioConfig.get('ims.contexts.cli.access_token.token')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong for a lot of reasons.

  • login context can be different things in different cases
  • we sidestep using IMS lib, but seem to know everything about it ...
  • what if the token is expired? we assume because it exists it is still good.
  • why even call IMS if we already have the token?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is updated with solution for above concern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@purplecabbage I have covered and tested (locally on my machine) for all the scenarios:

  1. deploy command for normal web app (non-standalone app)
  2. undeploy command for normal web app (non-standalone app)
  3. deploy command for standalone app (where no-token is required)
  4. undeploy command for standalone app (where no-token is required)

What if Token is expired Scenario : https://adobeio.slack.com/archives/C04HFLVUDLM/p1728303835889539?thread_ts=1728302643.048849&cid=C04HFLVUDLM

@amulyakashyap09
Copy link
Contributor Author

Closing this Pull request as this is not reflecting new changes of master branch , and reflecting lot of unnecessary changes making difficult to review. Will open a new PR for same.

@amulyakashyap09
Copy link
Contributor Author

Refer to PR: #821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants