Skip to content

Bugfix/acna 3518 clean build#857

Closed
dthampy wants to merge 11 commits intomasterfrom
bugfix/ACNA-3518-clean-build
Closed

Bugfix/acna 3518 clean build#857
dthampy wants to merge 11 commits intomasterfrom
bugfix/ACNA-3518-clean-build

Conversation

@dthampy
Copy link
Copy Markdown
Contributor

@dthampy dthampy commented Apr 17, 2025

Description

Implement clean command aio app clean-build to remove build artifacts from the local machine without affecting deployed resources

Related Issue

ACNA-3518

Motivation and Context

The aio app clean command is critical for developers who need to get a clean build environment without manually finding and deleting build files. During development, stale build artifacts can cause inconsistent behavior, especially when switching between different environments or configurations.

This command provides a reliable way to clean:

  • Action build artifacts
  • Web assets (both production and development)
  • Distribution directories while preserving deployment tracking file
  • Build tracking files

How Has This Been Tested?

testing was performed for each command flag as described in the README.md:

  • Tested aio app clean-build with default options to verify action and web assets are cleaned

  • Tested aio app clean-build --no-actions to verify only web assets are cleaned

  • Tested aio app clean-build --no-web-assets to verify only actions are cleaned

  • Tested aio app clean-build --dist-dir to verify the entire dist directory is cleaned while preserving deployment tracking

  • Tested aio app clean-build --tracking-files to verify build tracking files are cleaned

  • Tested aio app clean-build --dev to verify only development web assets are cleaned

  • Tested aio app clean-build --prod to verify only production web assets are cleaned

  • Verified integration with other commands by testing the sequence:

    • aio app build
    • aio app deploy
    • aio app clean-build --no-tracking-files
    • aio app run

Additionally, created dedicated tests for edge cases including:

  • When parent directory references are missing for web assets
  • Error handling when attempting to restore deployment tracking files
  • Various error formats to ensure proper error propagation

All tests pass with 100% branch coverage

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] 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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (fd0d8ec) to head (2ac230b).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #857   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           59        57    -2     
  Lines         3389      3304   -85     
  Branches       663       652   -11     
=========================================
- Hits          3389      3304   -85     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread package.json
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.6.0",
"istanbul": "^0.4.5",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Contributor Author

@dthampy dthampy Apr 17, 2025

Choose a reason for hiding this comment

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

Oh yeah I will remove that.
I was consistently running into jest coverage issue for few lines/branches although I added tests for them. So installed to help me identify untested parts of the code. Thanks for pointing that out

@@ -0,0 +1,1511 @@
/*
Copyright 2023 Adobe. All rights reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will update it

@@ -0,0 +1,293 @@
/*
Copyright 2023 Adobe. All rights reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit 2025

@dthampy
Copy link
Copy Markdown
Contributor Author

dthampy commented Apr 18, 2025

Closing this PR in favor of 858.
After a discussion with @purplecabbage, we agreed that it’s simpler and more consistent to always clean all build artifacts, rather than exposing individual flags. A
ll of the consolidated changes have been merged into PR #858—please take a look over there.

@dthampy dthampy closed this Apr 18, 2025
@shazron shazron deleted the bugfix/ACNA-3518-clean-build branch May 22, 2025 16:08
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.

2 participants