Skip to content

Commit

Permalink
AG-35891 Update Puppeteer and Node version for Scriptlets library
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/scriptlets from fix/AG-35891 to master

Squashed commit of the following:

commit a9bdb98
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 15:07:45 2024 +0200

    fix nit

commit 9e6d950
Author: Adam Wróblewski <adam@adguard.com>
Date:   Wed Sep 11 16:03:51 2024 +0300

    AG-35894 Tests failing for trusted-set-cookie. #453

    Merge in ADGUARD-FILTERS/scriptlets from fix/AG-35894 to fix/AG-35891

    Squashed commit of the following:

    commit e7e730f
    Merge: 43546c1 98ed01b
    Author: Maxim Topciu <mtopciu@adguard.com>
    Date:   Wed Sep 11 15:59:15 2024 +0300

        Merge branch 'fix/AG-35891' into fix/AG-35894

    commit 43546c1
    Author: Dávid Tóta <d.tota@adguard.com>
    Date:   Wed Sep 11 15:44:43 2024 +0300

        tests/scriptlets/trusted-set-cookie.test.js edited online with Bitbucket

    commit 78e2215
    Author: Dávid Tóta <d.tota@adguard.com>
    Date:   Wed Sep 11 15:44:35 2024 +0300

        tests/scriptlets/trusted-set-cookie.test.js edited online with Bitbucket

    commit 870e257
    Merge: 83ca0fa d17a55b
    Author: Adam Wróblewski <adam@adguard.com>
    Date:   Wed Sep 11 14:42:33 2024 +0200

        Merge branch 'fix/AG-35891' into fix/AG-35894

    commit 83ca0fa
    Author: Adam Wróblewski <adam@adguard.com>
    Date:   Wed Sep 11 14:25:33 2024 +0200

        Fix cookie with expires test

commit 98ed01b
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 14:50:52 2024 +0200

    update gh workflows

commit d17a55b
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 14:31:24 2024 +0200

    accept jsdoc defaults in eslint

commit 6660562
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 14:19:03 2024 +0200

    fix eslint warnings

commit 73242c9
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 14:18:44 2024 +0200

    disable tests temporarily

commit eb39027
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 12:39:53 2024 +0200

    fix install for node 20

commit 0213b99
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 12:34:17 2024 +0200

    test

commit 0173470
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 12:33:43 2024 +0200

    test

commit a18a90a
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 12:27:43 2024 +0200

    update puppeteer

commit c672bfa
Author: scripthunter7 <d.tota@adguard.com>
Date:   Wed Sep 11 12:09:32 2024 +0200

    update packages
  • Loading branch information
scripthunter7 committed Sep 11, 2024
1 parent f37ce70 commit bb54a02
Show file tree
Hide file tree
Showing 10 changed files with 505 additions and 235 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ module.exports = {
'jsdoc/require-param-description': 0,
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-description': 0,
'jsdoc/no-defaults': 0,
},
overrides: [
{
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Github Release

env:
NODE_VERSION: 18
NODE_VERSION: 20

# Workflow need write access to the repository to create a GitHub release
permissions:
Expand Down Expand Up @@ -32,10 +32,10 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
Expand Down Expand Up @@ -64,26 +64,22 @@ jobs:

notify:
name: Send Slack notification
needs:
- release

needs: release
# Note: 'always()' is needed to run the notify job even if the test job was failed
if:
${{ always() &&
(
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
)
${{
always() &&
github.repository == 'AdguardTeam/Scriptlets' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
}}
runs-on: ubuntu-latest
steps:
- name: Conclusion
uses: technote-space/workflow-conclusion-action@v3

- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: workflow, repo, message, commit, author, eventName, ref
status: ${{ needs.release.result }}
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
26 changes: 15 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test Scriptlets

env:
NODE_VERSION: 18
NODE_VERSION: 20

on:
push:
Expand All @@ -15,9 +15,9 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.jobs
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

Expand All @@ -34,25 +34,29 @@ jobs:
run: yarn build

notify:
needs:
- build

name: Send Slack notification on failure
needs: build
# Run this job only if the previous job failed and the event was triggered by the 'AdguardTeam/Scriptlets' repository
# Note: 'always()' is needed to run the notify job even if the test job was failed
if:
${{ always() &&
${{
always() &&
needs.check_code.result == 'failure' &&
github.repository == 'AdguardTeam/Scriptlets' &&
(
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
)
}}
runs-on: ubuntu-latest
steps:
- name: Conclusion
uses: technote-space/workflow-conclusion-action@v3
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: workflow, repo, message, commit, author, eventName, ref
status: failure
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: check_code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion bamboo-specs/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plan:
key: SCRIPTLETSBUILD
name: scriptlets - build
variables:
dockerContainer: adguard/puppeteer-runner:18.2--1
dockerContainer: adguard/puppeteer-runner:23.3--1

stages:
- Build:
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environments:

npmjs:
docker:
image: adguard/puppeteer-runner:18.2--1
image: adguard/puppeteer-runner:23.3--1
volumes:
${system.YARN_DIR}: "${bamboo.cacheYarn}"
triggers: [ ]
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plan:
key: SCRIPTLETSTEST
name: scriptlets - test new
variables:
dockerPuppeteer: adguard/puppeteer-runner:18.2--1
dockerPuppeteer: adguard/puppeteer-runner:23.3--1

stages:
- Build:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"eslint-plugin-compat": "^3.9.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import-newlines": "^1.3.1",
"eslint-plugin-jsdoc": "^41.1.1",
"eslint-plugin-jsdoc": "^50.2.2",
"fs-extra": "^10.0.1",
"husky": "^8.0.3",
"jest": "^29.5.0",
Expand All @@ -95,9 +95,9 @@
"lint-staged": "^12.1.2",
"markdownlint": "^0.28.2",
"markdownlint-cli": "^0.34.0",
"node-qunit-puppeteer": "2.1.1",
"node-qunit-puppeteer": "^2.2.0",
"openurl": "^1.1.1",
"qunit": "^2.9.3",
"qunit": "^2.22.0",
"rollup": "^3.15.0",
"rollup-plugin-cleanup": "^3.1.1",
"rollup-plugin-copy": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/redirects/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Redirects {
* Converts rawYaml into JS object with sources titles used as keys
*
* @param {string} rawYaml
* @returns {Object<Redirect>} - return object with titles in the keys and RedirectSources
* @returns {Redirect} - return object with titles in the keys and RedirectSources
* in the values
*/
constructor(rawYaml) {
Expand Down
3 changes: 3 additions & 0 deletions tests/scriptlets/trusted-set-cookie.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ test('Set cookie with expires', (assert) => {
const done = assert.async();

setTimeout(() => {
// It looks like Chrome is caching `document.cookie` and value is not updated,
// so as a workaround we remove dummy cookie to force update of `document.cookie`
clearCookie('dummyCookie');
assert.strictEqual(document.cookie.includes(cName), false, 'Cookie name has been deleted');
assert.strictEqual(document.cookie.includes(cValue), false, 'Cookie value has been deleted');
clearCookie(cName);
Expand Down
Loading

0 comments on commit bb54a02

Please sign in to comment.