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-1304] Filter actions deployments. #478

Merged
merged 15 commits into from
Oct 11, 2021

Conversation

florind-ens
Copy link
Contributor

@florind-ens florind-ens commented Sep 16, 2021

Changing the way deployments go.
On file change, it should deploy only its respective action.
It should not redeploy twice the same action packages if redeployment is called unless files were changed.

Extends: adobe/aio-lib-runtime#75

Description

Create a filter array based on the current file changed. This will help the deploy function to decide which actions to deploy.

Related Issue

#468

Motivation and Context

How Has This Been Tested?

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.

On file change it should only deploy it's respective action.
It should not redeploy twice the same action packages if redeployment is called unless files were changed.
@codecov
Copy link

codecov bot commented Sep 20, 2021

Codecov Report

Merging #478 (5e1c437) into master (bce1832) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #478   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           43        43           
  Lines         2262      2278   +16     
  Branches       375       377    +2     
=========================================
+ Hits          2262      2278   +16     
Impacted Files Coverage Δ
src/commands/app/build.js 100.00% <100.00%> (ø)
src/lib/actions-watcher.js 100.00% <100.00%> (ø)
src/lib/build-actions.js 100.00% <100.00%> (ø)
src/lib/deploy-actions.js 100.00% <100.00%> (ø)
src/lib/run-dev.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bce1832...5e1c437. Read the comment docs.

added a new way of filtering.
filtering by the already built actions.
@florind-ens florind-ens marked this pull request as ready for review September 23, 2021 13:01
src/lib/actions-watcher.js Outdated Show resolved Hide resolved
src/lib/deploy-actions.js Outdated Show resolved Hide resolved
src/lib/run-dev.js Outdated Show resolved Hide resolved
@florind-ens florind-ens requested a review from moritzraho October 7, 2021 15:02
.gitignore Outdated
@@ -14,3 +14,11 @@ oclif.manifest.json
package-lock.json

bin/openwhisk-standalone*.jar
/.idea/.gitignore
Copy link
Member

Choose a reason for hiding this comment

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

what about just /.idea/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right

Object.entries(config.manifest.full.packages).forEach(([, pkg]) => {
if (pkg.actions) {
Object.entries(pkg.actions).forEach(([actionName, action]) => {
if (action.function.includes(filePath)) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's be double safe here, this might not work if filePath or action.funtion is a windows path, or if filePath is absolut. What about making both to unix and absolut and check for equality ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, you are right, action.function will have a Unix path even if it's generated on windows.

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.

few nitpicks comments otherwise lgtm, feel free to merge after resolving those

@florind-ens florind-ens merged commit 9551029 into master Oct 11, 2021
@shazron shazron deleted the bugfix/ACNA-1304-filter-actions branch June 10, 2022 08:44
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.

3 participants