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

[Release] Stage to Main 08/08 #387

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/preview-index/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "commonjs",
"sideEffects": false,
"scripts": {
"index": "node src/update.js"
"index": "node src/update.js",
"testevent": "node src/testevent.js"
},
"dependencies": {
"@azure/msal-node": "^2.11.0",
Expand Down
2 changes: 2 additions & 0 deletions .github/preview-index/src/testevent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
console.log('PREVIEW EVENT');
console.log(process.env.npm_config_payload);
27 changes: 18 additions & 9 deletions .github/workflows/fg-sync-repos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Floodgate Repo Sync

on:
push:
branches:
- stage
- main
workflow_dispatch:
inputs:
syncBranch:
Expand Down Expand Up @@ -28,7 +32,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.syncBranch }}
ref: ${{ inputs.syncBranch || github.ref_name }}

- name: Clone Floodgate Repository and Checkout Selected Branch
run: |
Expand All @@ -41,7 +45,7 @@ jobs:
echo "cc branch"
git branch
env:
FG_SYNC_BRANCH: ${{ inputs.syncBranch }}
FG_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}

- name: Overwrite floodgate repo files with latest from source repo
run: |
Expand All @@ -54,14 +58,19 @@ jobs:
git branch
git config user.email "$FG_SYNC_BOT_EMAIL"
git config user.name "$FG_SYNC_BOT_NAME"
git status
git remote set-url origin https://oauth2:[email protected]/adobecom/cc-pink.git
git remote -v
git add .
git commit -m "Syncing cc to cc-pink"
git push origin $FG_SYNC_BRANCH --force
git status
if [[ -n $(git status -s) ]]; then
git remote set-url origin https://oauth2:[email protected]/adobecom/cc-pink.git
git remote -v
git add .
git commit -m "Syncing cc to cc-pink"
git push origin $FG_SYNC_BRANCH --force
echo ":heavy_check_mark: Syncing branch $FG_SYNC_BRANCH on cc to cc-pink completed successfully." >> $GITHUB_STEP_SUMMARY
else
echo ":heavy_minus_sign: No changes detected on branch $FG_SYNC_BRANCH, nothing to sync." >> $GITHUB_STEP_SUMMARY
fi
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
FG_SYNC_BOT_EMAIL: ${{ secrets.FG_SYNC_BOT_EMAIL }}
FG_SYNC_BOT_NAME: ${{ secrets.FG_SYNC_BOT_NAME }}
FG_SYNC_BRANCH: ${{ inputs.syncBranch }}
FG_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}
26 changes: 18 additions & 8 deletions .github/workflows/graybox-sync-repos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Graybox Repo Sync

on:
push:
branches:
- stage
- main
workflow_dispatch:
inputs:
syncBranch:
Expand All @@ -10,6 +14,7 @@ on:
type: choice
options:
- 'stage'
- 'main'

jobs:
build:
Expand All @@ -28,7 +33,7 @@ jobs:
uses: actions/checkout@v2
with:
persist-credentials: false
ref: ${{ inputs.syncBranch }}
ref: ${{ inputs.syncBranch || github.ref_name }}

- name: Clone Graybox Repository and Checkout Stage Branch
run: |
Expand All @@ -41,7 +46,7 @@ jobs:
echo "cc branch"
git branch
env:
GB_SYNC_BRANCH: ${{ inputs.syncBranch }}
GB_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}

- name: Overwrite graybox repo files with latest from source repo
run: |
Expand All @@ -55,12 +60,17 @@ jobs:
git config user.email "$FG_SYNC_BOT_EMAIL"
git config user.name "milo-repo-sync[bot]"
git status
git remote set-url origin https://oauth2:[email protected]/adobecom/cc-graybox.git
git remote -v
git add .
git commit -m "Syncing cc to cc-graybox"
git push origin $GB_SYNC_BRANCH --force
if [[ -n $(git status -s) ]]; then
git remote set-url origin https://oauth2:[email protected]/adobecom/cc-graybox.git
git remote -v
git add .
git commit -m "Syncing cc to cc-graybox"
git push origin $GB_SYNC_BRANCH --force
echo ":heavy_check_mark: Syncing branch $GB_SYNC_BRANCH on cc to cc-graybox completed successfully." >> $GITHUB_STEP_SUMMARY
else
echo ":heavy_minus_sign: No changes detected on branch $GB_SYNC_BRANCH, nothing to sync." >> $GITHUB_STEP_SUMMARY
fi
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
FG_SYNC_BOT_EMAIL: ${{ secrets.FG_SYNC_BOT_EMAIL }}
GB_SYNC_BRANCH: ${{ inputs.syncBranch }}
GB_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}
40 changes: 40 additions & 0 deletions .github/workflows/run-preview-index-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run preview index test

on:
workflow_dispatch: # Allow manual trigger
repository_dispatch:
types:
- resource-previewed

jobs:
print:
runs-on: ubuntu-latest
steps:
- run: |
echo "Status: ${{ github.event.client_payload.status }}"
echo "Path: ${{ github.event.client_payload.path }}"
run-preview-index-test:
name: Test reindexing preview resources
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
cd .github/preview-index
npm install

- name: Test reindex preview resources
run: |
cd .github/preview-index
npm run testevent --payload=${{ toJson(github.event.client_payload) }}
3 changes: 3 additions & 0 deletions creativecloud/blocks/unity/unity.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.unity {
display: none;
}
23 changes: 23 additions & 0 deletions creativecloud/blocks/unity/unity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { loadStyle } from '../../scripts/utils.js';

function getUnityLibs(prodLibs = '/unitylibs') {
const { hostname } = window.location;
if (!hostname.includes('hlx.page')
&& !hostname.includes('hlx.live')
&& !hostname.includes('localhost')) {
return prodLibs;
}
const branch = new URLSearchParams(window.location.search).get('unitylibs') || 'main';
if (branch.indexOf('--') > -1) return `https://${branch}.hlx.live/unitylibs`;
return `https://${branch}--unity--adobecom.hlx.live/unitylibs`;
}

export default async function init(el) {
const unitylibs = getUnityLibs();
const stylePromise = new Promise((resolve) => {
loadStyle(`${unitylibs}/core/styles/styles.css`, resolve);
});
await stylePromise;
const { default: wfinit } = await import(`${unitylibs}/core/workflow/workflow.js`);
await wfinit(el, 'cc', unitylibs);
}
5 changes: 5 additions & 0 deletions creativecloud/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ const CONFIG = {
prodDomains: ['www.adobe.com', 'helpx.adobe.com', 'business.adobe.com'],
stageDomainsMap,
decorateArea,
adobeid: {
api_parameters: { check_token: { guest_allowed: true } },
enableGuestAccounts: true,
enableGuestTokenForceRefresh: true,
},
stage: {
pdfViewerClientId: '9f7f19a46bd542e2b8548411e51eb4d4',
pdfViewerReportSuite: 'adbadobenonacdcqa',
Expand Down
Loading
Loading