Skip to content

Commit

Permalink
Release build 6.0.0 [ci release]
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane authored and github-actions[bot] committed Jul 8, 2024
1 parent 7ac68ae commit 9c65477
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 28 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,48 @@ jobs:
run: npm run build

- name: Create and push release branch
id: create_branch
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b pr-releases/pr-${PR_NUMBER}
git add -f build
git commit -m "Add build folder for PR #${PR_NUMBER}"
git add -f build Sources
git commit -m "Add build folder for PR ${PR_NUMBER}"
git push -u origin pr-releases/pr-${PR_NUMBER} --force
echo "BRANCH_NAME=pr-releases/pr-${PR_NUMBER}" >> $GITHUB_ENV
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Post comment on PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const branchName = process.env.BRANCH_NAME;
const commitHash = process.env.COMMIT_HASH;
const prNumber = context.issue.number;
const repoUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}`;
const branchUrl = `${repoUrl}/tree/${branchName}`;
const commitUrl = `${repoUrl}/commit/${commitHash}`;
const commentBody = `
### Temporary Branch Update
The temporary branch has been updated with the latest changes. Below are the details:
- **Branch Name**: [${branchName}](${branchUrl})
- **Commit Hash**: [${commitHash}](${commitUrl})
- **Install Command**: \`npm i github:duckduckgo/content-scope-scripts#${commitHash}\`
Please use the above install command to update to the latest version.
`;
await github.rest.issues.createComment({
...context.repo,
issue_number: prNumber,
body: commentBody
});
clean_up:
if: github.event.action == 'closed'
Expand Down
25 changes: 20 additions & 5 deletions Sources/ContentScopeScripts/dist/contentScopeIsolated.js
Original file line number Diff line number Diff line change
Expand Up @@ -3307,6 +3307,7 @@
}
}

const MSG_NAME_INITIAL_SETUP = 'initialSetup';
const MSG_NAME_SET_VALUES = 'setUserValues';
const MSG_NAME_READ_VALUES = 'getUserValues';
const MSG_NAME_READ_VALUES_SERP = 'readUserValues';
Expand Down Expand Up @@ -3338,6 +3339,13 @@
this.messaging = messaging;
}

/**
* @returns {Promise<import("../duck-player.js").OverlaysInitialSettings>}
*/
initialSetup () {
return this.messaging.request(MSG_NAME_INITIAL_SETUP)
}

/**
* Inform the native layer that an interaction occurred
* @param {import("../duck-player.js").UserValues} userValues
Expand Down Expand Up @@ -4863,20 +4871,22 @@
// bind early to attach all listeners
const domState = new DomState();

/** @type {import("../duck-player.js").UserValues} */
let userValues;
/** @type {import("../duck-player.js").OverlaysInitialSettings} */
let initialSetup;
try {
userValues = await messages.getUserValues();
initialSetup = await messages.initialSetup();
} catch (e) {
console.error(e);
return
}

if (!userValues) {
if (!initialSetup) {
console.error('cannot continue without user settings');
return
}

let { userValues } = initialSetup;

/**
* Create the instance - this might fail if settings or user preferences prevent it
* @type {Thumbnails|undefined}
Expand Down Expand Up @@ -5050,7 +5060,7 @@
* #### Messages:
*
* On Page Load
* - {@link DuckPlayerOverlayMessages.getUserValues} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.initialSetup} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.onUserValuesChanged} subscription begins immediately - it will continue to listen for updates
*
* Then the following message can be sent at any time
Expand Down Expand Up @@ -5078,6 +5088,11 @@
* @property {boolean} overlayInteracted - always a boolean
*/

/**
* @typedef OverlaysInitialSettings - The initial payload used to communicate render-blocking information
* @property {UserValues} userValues
*/

/**
* @internal
*/
Expand Down
25 changes: 20 additions & 5 deletions build/contentScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -11755,6 +11755,7 @@
}
}

const MSG_NAME_INITIAL_SETUP = 'initialSetup';
const MSG_NAME_SET_VALUES = 'setUserValues';
const MSG_NAME_READ_VALUES = 'getUserValues';
const MSG_NAME_READ_VALUES_SERP = 'readUserValues';
Expand Down Expand Up @@ -11786,6 +11787,13 @@
this.messaging = messaging;
}

/**
* @returns {Promise<import("../duck-player.js").OverlaysInitialSettings>}
*/
initialSetup () {
return this.messaging.request(MSG_NAME_INITIAL_SETUP)
}

/**
* Inform the native layer that an interaction occurred
* @param {import("../duck-player.js").UserValues} userValues
Expand Down Expand Up @@ -13242,20 +13250,22 @@
// bind early to attach all listeners
const domState = new DomState();

/** @type {import("../duck-player.js").UserValues} */
let userValues;
/** @type {import("../duck-player.js").OverlaysInitialSettings} */
let initialSetup;
try {
userValues = await messages.getUserValues();
initialSetup = await messages.initialSetup();
} catch (e) {
console.error(e);
return
}

if (!userValues) {
if (!initialSetup) {
console.error('cannot continue without user settings');
return
}

let { userValues } = initialSetup;

/**
* Create the instance - this might fail if settings or user preferences prevent it
* @type {Thumbnails|undefined}
Expand Down Expand Up @@ -13429,7 +13439,7 @@
* #### Messages:
*
* On Page Load
* - {@link DuckPlayerOverlayMessages.getUserValues} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.initialSetup} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.onUserValuesChanged} subscription begins immediately - it will continue to listen for updates
*
* Then the following message can be sent at any time
Expand Down Expand Up @@ -13457,6 +13467,11 @@
* @property {boolean} overlayInteracted - always a boolean
*/

/**
* @typedef OverlaysInitialSettings - The initial payload used to communicate render-blocking information
* @property {UserValues} userValues
*/

/**
* @internal
*/
Expand Down
25 changes: 20 additions & 5 deletions build/integration/contentScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -11755,6 +11755,7 @@
}
}

const MSG_NAME_INITIAL_SETUP = 'initialSetup';
const MSG_NAME_SET_VALUES = 'setUserValues';
const MSG_NAME_READ_VALUES = 'getUserValues';
const MSG_NAME_READ_VALUES_SERP = 'readUserValues';
Expand Down Expand Up @@ -11786,6 +11787,13 @@
this.messaging = messaging;
}

/**
* @returns {Promise<import("../duck-player.js").OverlaysInitialSettings>}
*/
initialSetup () {
return this.messaging.request(MSG_NAME_INITIAL_SETUP)
}

/**
* Inform the native layer that an interaction occurred
* @param {import("../duck-player.js").UserValues} userValues
Expand Down Expand Up @@ -13242,20 +13250,22 @@
// bind early to attach all listeners
const domState = new DomState();

/** @type {import("../duck-player.js").UserValues} */
let userValues;
/** @type {import("../duck-player.js").OverlaysInitialSettings} */
let initialSetup;
try {
userValues = await messages.getUserValues();
initialSetup = await messages.initialSetup();
} catch (e) {
console.error(e);
return
}

if (!userValues) {
if (!initialSetup) {
console.error('cannot continue without user settings');
return
}

let { userValues } = initialSetup;

/**
* Create the instance - this might fail if settings or user preferences prevent it
* @type {Thumbnails|undefined}
Expand Down Expand Up @@ -13429,7 +13439,7 @@
* #### Messages:
*
* On Page Load
* - {@link DuckPlayerOverlayMessages.getUserValues} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.initialSetup} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.onUserValuesChanged} subscription begins immediately - it will continue to listen for updates
*
* Then the following message can be sent at any time
Expand Down Expand Up @@ -13457,6 +13467,11 @@
* @property {boolean} overlayInteracted - always a boolean
*/

/**
* @typedef OverlaysInitialSettings - The initial payload used to communicate render-blocking information
* @property {UserValues} userValues
*/

/**
* @internal
*/
Expand Down
25 changes: 20 additions & 5 deletions build/windows/contentScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -8550,6 +8550,7 @@
}
}

const MSG_NAME_INITIAL_SETUP = 'initialSetup';
const MSG_NAME_SET_VALUES = 'setUserValues';
const MSG_NAME_READ_VALUES = 'getUserValues';
const MSG_NAME_READ_VALUES_SERP = 'readUserValues';
Expand Down Expand Up @@ -8581,6 +8582,13 @@
this.messaging = messaging;
}

/**
* @returns {Promise<import("../duck-player.js").OverlaysInitialSettings>}
*/
initialSetup () {
return this.messaging.request(MSG_NAME_INITIAL_SETUP)
}

/**
* Inform the native layer that an interaction occurred
* @param {import("../duck-player.js").UserValues} userValues
Expand Down Expand Up @@ -10106,20 +10114,22 @@
// bind early to attach all listeners
const domState = new DomState();

/** @type {import("../duck-player.js").UserValues} */
let userValues;
/** @type {import("../duck-player.js").OverlaysInitialSettings} */
let initialSetup;
try {
userValues = await messages.getUserValues();
initialSetup = await messages.initialSetup();
} catch (e) {
console.error(e);
return
}

if (!userValues) {
if (!initialSetup) {
console.error('cannot continue without user settings');
return
}

let { userValues } = initialSetup;

/**
* Create the instance - this might fail if settings or user preferences prevent it
* @type {Thumbnails|undefined}
Expand Down Expand Up @@ -10293,7 +10303,7 @@
* #### Messages:
*
* On Page Load
* - {@link DuckPlayerOverlayMessages.getUserValues} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.initialSetup} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.onUserValuesChanged} subscription begins immediately - it will continue to listen for updates
*
* Then the following message can be sent at any time
Expand Down Expand Up @@ -10321,6 +10331,11 @@
* @property {boolean} overlayInteracted - always a boolean
*/

/**
* @typedef OverlaysInitialSettings - The initial payload used to communicate render-blocking information
* @property {UserValues} userValues
*/

/**
* @internal
*/
Expand Down
10 changes: 9 additions & 1 deletion integration-test/playwright/page-objects/duckplayer-overlays.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ export class DuckplayerOverlays {
async userSettingIs (setting) {
await this.page.addInitScript(mockResponses, {
responses: {
getUserValues: userValues[setting]
initialSetup: {
userValues: userValues[setting]
}
}
})
}
Expand Down Expand Up @@ -445,6 +447,12 @@ export class DuckplayerOverlays {
featureName: 'duckPlayer'
},
responses: {
initialSetup: {
userValues: {
privatePlayerMode: { alwaysAsk: {} },
overlayInteracted: false
}
},
getUserValues: {
privatePlayerMode: { alwaysAsk: {} },
overlayInteracted: false
Expand Down
7 changes: 6 additions & 1 deletion src/features/duck-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* #### Messages:
*
* On Page Load
* - {@link DuckPlayerOverlayMessages.getUserValues} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.initialSetup} is initially called to get the current settings
* - {@link DuckPlayerOverlayMessages.onUserValuesChanged} subscription begins immediately - it will continue to listen for updates
*
* Then the following message can be sent at any time
Expand Down Expand Up @@ -45,6 +45,11 @@ import { Environment, initOverlays } from './duckplayer/overlays.js'
* @property {boolean} overlayInteracted - always a boolean
*/

/**
* @typedef OverlaysInitialSettings - The initial payload used to communicate render-blocking information
* @property {UserValues} userValues
*/

/**
* @internal
*/
Expand Down
1 change: 1 addition & 0 deletions src/features/duckplayer/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const MSG_NAME_INITIAL_SETUP = 'initialSetup'
export const MSG_NAME_SET_VALUES = 'setUserValues'
export const MSG_NAME_READ_VALUES = 'getUserValues'
export const MSG_NAME_READ_VALUES_SERP = 'readUserValues'
Expand Down
7 changes: 7 additions & 0 deletions src/features/duckplayer/overlay-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export class DuckPlayerOverlayMessages {
this.messaging = messaging
}

/**
* @returns {Promise<import("../duck-player.js").OverlaysInitialSettings>}
*/
initialSetup () {
return this.messaging.request(constants.MSG_NAME_INITIAL_SETUP)
}

/**
* Inform the native layer that an interaction occurred
* @param {import("../duck-player.js").UserValues} userValues
Expand Down
Loading

0 comments on commit 9c65477

Please sign in to comment.