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

MWPW-141047 CI/CD for Akamai edge worker code #532

Merged
merged 5 commits into from
Feb 21, 2024
Merged

MWPW-141047 CI/CD for Akamai edge worker code #532

merged 5 commits into from
Feb 21, 2024

Conversation

TsayAdobe
Copy link
Collaborator

  • The workflow for deploying an edge worker is .github/workflows/deploy-edgeworker.yml
  • The code bundles for edge workers are in the directory edgewokers
  • The unit tests for edge workers are in the directory test/edgeworkers
  • GitHub Action Deploy Akamai Edgeworkers is used for deploying to Akamai. This GHA requires scripts other than main.js in the utils folder.
  • The mocks for unit tests are from Akamai EdgeWorkers Test Mocks with some modification
  • To run the edge worker unit tests only
    npm run ewtest
    
    The edge worker unit tests are included and the coverage report is generated when running the existing command npm test and npm run jest.
  • To build the edge worker code for the deployment bundle.
    npm run ewbuild
    
    It run the script edgeworkers/scripts/build.js, which copies the dependency files to the bundle directory.
  • To build the deployment bundle for the stage edge worker.
    npm run ewprod2stg
    
    It run the script edgeworkers/scripts/prod2stg.js, which copies the prod edge worker directory to the stage one and modify some flags for the stage environment.
  • To do: Need a script to increment to the version in bundle.json
  • To do: The code coverage is high, but it may need more unit tests.

Copy link

aem-code-sync bot commented Feb 2, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (648b2a4) 99.02% compared to head (916d854) 99.27%.
Report is 24 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage     #532      +/-   ##
==========================================
+ Coverage   99.02%   99.27%   +0.25%     
==========================================
  Files          26       32       +6     
  Lines        2961     3856     +895     
==========================================
+ Hits         2932     3828     +896     
+ Misses         29       28       -1     

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

edgeworkers/Acrobat_DC_web_prod/bundle.json Show resolved Hide resolved
@@ -0,0 +1,18 @@
import stage from './stage.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a way we can link everything in the csp/ folder to https://github.com/adobecom/dc/tree/stage/acrobat/scripts/contentSecurityPolicy

@@ -0,0 +1,11 @@
const fs = require('fs');
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think what we want is stg2prod? Typically, we should be promoting changes from stage to prod only. Note: we have a way to detect isProd from the environment without hard-coding it. I'll work on that separately.

Copy link
Collaborator

@peller peller Feb 18, 2024

Choose a reason for hiding this comment

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

If you update to the latest edgeworker code on stage, isProd is discovered based on the environment. It no longer needs to be updated here.

@TsayAdobe TsayAdobe merged commit 375f46f into stage Feb 21, 2024
6 of 7 checks passed
@Blainegunn Blainegunn deleted the ewdeploy branch March 5, 2024 15:10
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.

5 participants