-
Notifications
You must be signed in to change notification settings - Fork 214
@W-17760517@ Automatically update bug bounty instance on new release #2291
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
Changes from 9 commits
bfd292d
6471df4
bbaafa6
810b7e2
1c4a6db
f8d52c7
ba8b951
0c28536
d57a267
604e058
15283de
ca3f3f9
9df13a3
40807d8
75044f5
60d36e1
91c131c
df36823
ad2d28e
85d897b
d868d2f
b08d3b7
375cadc
4f97742
f31a88e
a5d9b6b
daef558
a9c008d
b7abbbe
1e49dfb
b385868
6943664
9e00082
4c628b6
a4a234d
b96c79a
3d66b85
272f034
c9b987c
eed6885
b536282
377aca5
36d6825
a5e2d3b
8f5583d
5a47a8c
8c39519
0e512b8
99dca1e
8909da9
809f673
34e7bc1
81ea5a9
36ec0af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||||||||||||||||||||
| name: SalesforceCommerceCloud/pwa-kit/bug_bounty | ||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| # Runs this job when a new Github release is published | ||||||||||||||||||||||||||
| # TODO: How do we ensure this only runs for the latest major version? We don't want to run this | ||||||||||||||||||||||||||
| # for a new v2 release. But due to policy, we are not allowed to use unverified marketplace actions | ||||||||||||||||||||||||||
| # such as https://github.com/marketplace/actions/version-check | ||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||
| types: [released] | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||
| deploy-bug-bounty: | ||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we missing defining the Node version so we make sure we use one of the MRT supported versions? pwa-kit/.github/workflows/test.yml Lines 170 to 174 in e130f4b
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking of relying on the pre-installed node so that we'd have less maintenance and not have to manually bump these node versions up but this is a fair point. We already have to update the node versions of other jobs manually so I'll add this
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A simple idea at least for the workflows like And update the Setup node step to: It seem like people is using that approach: |
||||||||||||||||||||||||||
| - name: Install Monorepo Dependencies | ||||||||||||||||||||||||||
| run: |- | ||||||||||||||||||||||||||
| # Install node dependencies | ||||||||||||||||||||||||||
| node ./scripts/gtime.js monorepo_install npm ci | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Generate Retail App Demo | ||||||||||||||||||||||||||
| uses: ./.github/actions/e2e_generate_app | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| PROJECT_KEY: "retail-react-app-bug-bounty" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Create MRT credentials file | ||||||||||||||||||||||||||
| uses: "./.github/actions/create_mrt" | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| mobify_user: ${{ secrets.MOBIFY_STG_CLIENT_USER }} | ||||||||||||||||||||||||||
| mobify_api_key: ${{ secrets.MOBIFY_STG_CLIENT_API_KEY }} | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Push Bundle to MRT (Bug Bounty) | ||||||||||||||||||||||||||
| uses: "./.github/actions/push_to_mrt" | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| CWD: "../generated-projects/retail-react-app-bug-bounty" | ||||||||||||||||||||||||||
| TARGET: testing | ||||||||||||||||||||||||||
| PROJECT: pwa-kit | ||||||||||||||||||||||||||
| FLAGS: --cloud-origin https://cloud-testing.mobify-staging.com -c ~/.mobify --wait | ||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,8 @@ program | |
| 'retail-app-demo', | ||
| 'retail-app-ext', | ||
| 'retail-app-no-ext', | ||
| 'retail-app-private-client' | ||
| 'retail-app-private-client', | ||
| 'retail-react-app-bug-bounty' | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm leveraging the generate project script in the e2e directory but it may be a good idea in the future to move this if we continue to use the script for jobs other than the e2e test CI. |
||
| ] | ||
| if (!validKeys.includes(value)) { | ||
| throw new Error('Invalid project key.') | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -320,6 +320,31 @@ const PRESETS = [ | |||||
| assets: ['translations'], | ||||||
| private: true | ||||||
| }, | ||||||
| { | ||||||
| id: 'retail-react-app-bug-bounty', | ||||||
| name: 'Retail React App Bug Bounty Project', | ||||||
| description: '', | ||||||
| templateSource: { | ||||||
| type: TEMPLATE_SOURCE_NPM, | ||||||
| id: '@salesforce/retail-react-app' | ||||||
| }, | ||||||
| questions: [...EXTENSIBILITY_QUESTIONS, ...HYBRID_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS], | ||||||
|
||||||
| questions: [...EXTENSIBILITY_QUESTIONS, ...HYBRID_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS], | |
| questions: [...EXTENSIBILITY_QUESTIONS, ...RETAIL_REACT_APP_QUESTIONS], |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be false? The scope is to test Retail React App, not Hybrid scenarios.
| ['project.hybrid']: true, | |
| ['project.hybrid']: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. This is a PWA only site so I'll change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a different Einstein instance to avoid affecting the analytics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really have another Einstein instance set up for PWA tests so we use this one as a default.
This is the same Einstein instance we use in our day to day development so I don't think there'll be much of an impact if we send even more data from another test instance (which our bug bounty instance is) to it.
We can change this to a different instance if there is a need for us to specifically watch the Einstein events generated by the bug bounty instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would you consider separating the jobs into two or create a separate GitHub Actions to avoid checking
if: env.IS_LATEST_RELEASE == 'true'on each step?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested, I have separated the latest release check into a separate job.
Here is the flow working (when the condition to trigger is reversed so we proceed if the release is not latest, for testing purposes): https://github.com/SalesforceCommerceCloud/pwa-kit/actions/runs/13576833436/job/37954917447
And here is the flow failing (when the condition to trigger the flow is correct so that we only deploy on latest):
https://github.com/SalesforceCommerceCloud/pwa-kit/actions/runs/13576920319/job/37955192027
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach also allows us to add other deploy jobs to the workflow later on so this is a really good suggestion @adamraya !