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

Make it harder to overwrite published, Production apps #559

Merged
merged 10 commits into from
Sep 26, 2022

Conversation

MichaelGoberling
Copy link
Contributor

This pull request proposes checking the Extension Registry API to see if an App Builder application is in a published state before attempting to deploy action code or web assets. It also proposes adding a flag which will bypass this check and allow users to deploy code for published Production applications.

Description

These changes implement the new Console API and Extension Registry API changes introduced here so that we can determine if an App Builder application is in a published state or not.

The getProject function was needed from the Console API so that we can fetch the appId for the project that is stored in the Extension Registry.

A new flag force-deploy has been added as a part of this pull request for the deploy command that bypasses this check.

Related Issue

Motivation and Context

To make it more difficult to overwrite published Production App Builder applications.

How Has This Been Tested?

Tested locally with npm run test and linked version of aio-cli-lib-console and aio-lib-console.

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.

@shazron
Copy link
Member

shazron commented Jul 19, 2022

@MichaelGoberling code conflict reported, can you resolve so the tests run?

Copy link
Member

@moritzraho moritzraho left a comment

Choose a reason for hiding this comment

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

code lgtm, comments about flag descriptions

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
@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #559 (a54bbd9) into master (2225901) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #559   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        50           
  Lines         2619      2629   +10     
  Branches       476       478    +2     
=========================================
+ Hits          2619      2629   +10     
Impacted Files Coverage Δ
src/commands/app/deploy.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shazron
Copy link
Member

shazron commented Aug 25, 2022

Update: We are still looking over semantics to make sure the --force-deploy flag makes sense. Discussion and final decision needed before merging.

@purplecabbage
Copy link
Member

I can't think of a better syntax for triggering this functionality so I will lets move forward with this.

@purplecabbage purplecabbage merged commit 4197d2e into adobe:master Sep 26, 2022
@shazron
Copy link
Member

shazron commented Oct 3, 2022

This caused a bug: #587 (am fixing)

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

Successfully merging this pull request may close these issues.

4 participants