@duckduckgo/autoconsent 12.16.0 → 12.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,20 +10,22 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
  if: github.event.pull_request.merged == true
12
12
  steps:
13
- - name: Find Asana task ID
14
- id: find-task
15
- uses: duckduckgo/native-github-asana-sync@v1.5
13
+ - name: Find Asana task ID(s)
14
+ id: find-tasks
15
+ uses: duckduckgo/native-github-asana-sync@main
16
+ continue-on-error: true
16
17
  with:
17
- action: 'find-asana-task-id'
18
+ action: 'find-asana-task-ids'
18
19
  asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
19
20
  trigger-phrase: 'Task/Issue URL:'
21
+ asana-project: '1203268166580279' # CPM (Cookie Pop-up Management) Triage project
20
22
 
21
- - name: Move task to "Scheduled for release" section
22
- if: steps.find-task.outputs.asanaTaskId
23
- uses: duckduckgo/native-github-asana-sync@v1.5
23
+ - name: Move task(s) to "Scheduled for release" section
24
+ if: steps.find-tasks.outputs.asanaTaskIds
25
+ uses: duckduckgo/native-github-asana-sync@main
24
26
  with:
25
27
  action: 'add-task-asana-project'
26
28
  asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
27
29
  asana-project: '1203268166580279' # CPM (Cookie Pop-up Management) Triage project
28
30
  asana-section: '1207140808076253' # "Scheduled for release" section ID
29
- asana-task-id: ${{ steps.find-task.outputs.asanaTaskId }}
31
+ asana-task-id: ${{ steps.find-tasks.outputs.asanaTaskIds }}
@@ -10,28 +10,31 @@ jobs:
10
10
  process-asana-tasks:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - name: Add comment to Asana task
14
- uses: duckduckgo/native-github-asana-sync@v1.5
13
+ - name: Find Asana task ID(s)
14
+ id: find-tasks
15
+ uses: duckduckgo/native-github-asana-sync@main
16
+ continue-on-error: true
15
17
  with:
16
- action: 'add-asana-comment'
18
+ action: 'find-asana-task-ids'
17
19
  asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
18
20
  trigger-phrase: 'Task/Issue URL:'
19
- is-pinned: 'false'
21
+ asana-project: '1203268166580279' # CPM (Cookie Pop-up Management) Triage project
20
22
 
21
- - name: Find Asana task ID
22
- id: find-task
23
- uses: duckduckgo/native-github-asana-sync@v1.5
23
+ - name: Add comment to Asana task(s)
24
+ if: steps.find-tasks.outputs.asanaTaskIds
25
+ uses: duckduckgo/native-github-asana-sync@main
24
26
  with:
25
- action: 'find-asana-task-id'
27
+ action: 'add-asana-comment'
26
28
  asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
27
29
  trigger-phrase: 'Task/Issue URL:'
30
+ asana-project: '1203268166580279' # CPM (Cookie Pop-up Management) Triage project
28
31
 
29
- - name: Move task to "Awaiting review" section
30
- if: steps.find-task.outputs.asanaTaskId
31
- uses: duckduckgo/native-github-asana-sync@v1.5
32
+ - name: Move task(s) to "Awaiting review" section
33
+ if: steps.find-tasks.outputs.asanaTaskIds
34
+ uses: duckduckgo/native-github-asana-sync@main
32
35
  with:
33
36
  action: 'add-task-asana-project'
34
37
  asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
35
38
  asana-project: '1203268166580279' # CPM (Cookie Pop-up Management) Triage project
36
39
  asana-section: '1209767000096488' # "Awaiting review" section ID
37
- asana-task-id: ${{ steps.find-task.outputs.asanaTaskId }}
40
+ asana-task-id: ${{ steps.find-tasks.outputs.asanaTaskIds }}
package/CHANGELOG.md CHANGED
@@ -1,3 +1,57 @@
1
+ # v12.18.0 (Tue Apr 29 2025)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Delay reruns of the detectCmp phase until there is a dom mutation. [#721](https://github.com/duckduckgo/autoconsent/pull/721) ([@sammacbeth](https://github.com/sammacbeth))
6
+ - Prioritize checking of site-specific rules in detection phase. [#720](https://github.com/duckduckgo/autoconsent/pull/720) ([@sammacbeth](https://github.com/sammacbeth))
7
+ - Run detection phase sequentially per CMP. [#719](https://github.com/duckduckgo/autoconsent/pull/719) ([@sammacbeth](https://github.com/sammacbeth))
8
+ - Fix rule for openai [#723](https://github.com/duckduckgo/autoconsent/pull/723) ([@muodov](https://github.com/muodov))
9
+ - Update EasyList Cookie to 39338825841d682f464b10b174ea835000e30c0f [#722](https://github.com/duckduckgo/autoconsent/pull/722) ([@sammacbeth](https://github.com/sammacbeth) [@github-actions[bot]](https://github.com/github-actions[bot]))
10
+
11
+ #### 🐛 Bug Fix
12
+
13
+ - Only process Asana tasks when PR contains task URL [#718](https://github.com/duckduckgo/autoconsent/pull/718) ([@noisysocks](https://github.com/noisysocks))
14
+
15
+ #### Authors: 4
16
+
17
+ - [@github-actions[bot]](https://github.com/github-actions[bot])
18
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
19
+ - Robert Anderson ([@noisysocks](https://github.com/noisysocks))
20
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
21
+
22
+ ---
23
+
24
+ # v12.17.0 (Mon Apr 14 2025)
25
+
26
+ #### 🚀 Enhancement
27
+
28
+ - Update EasyList Cookie to e1d6329233498d8cb5a5fe473e516475ee3da6e8 [#713](https://github.com/duckduckgo/autoconsent/pull/713) ([@sammacbeth](https://github.com/sammacbeth) [@github-actions[bot]](https://github.com/github-actions[bot]))
29
+ - Bump the dev-dependencies group across 1 directory with 5 updates [#715](https://github.com/duckduckgo/autoconsent/pull/715) ([@dependabot[bot]](https://github.com/dependabot[bot]))
30
+ - Add rule for nos.nl [#712](https://github.com/duckduckgo/autoconsent/pull/712) ([@noisysocks](https://github.com/noisysocks))
31
+ - Update EasyList Cookie to 54998140e5d5e212ead7be504a42fe3afb8cfdc6 [#708](https://github.com/duckduckgo/autoconsent/pull/708) ([@sammacbeth](https://github.com/sammacbeth) [@github-actions[bot]](https://github.com/github-actions[bot]))
32
+
33
+ #### 🐛 Bug Fix
34
+
35
+ - Jenkins CI: Use GIT_COMMIT when notifying GitHub [#714](https://github.com/duckduckgo/autoconsent/pull/714) ([@noisysocks](https://github.com/noisysocks))
36
+ - Update Asana integration to support multiple tasks and ignore tasks not in CPM project [#707](https://github.com/duckduckgo/autoconsent/pull/707) ([@noisysocks](https://github.com/noisysocks))
37
+ - Update CI pipeline to run only relevant tests for a PR [#710](https://github.com/duckduckgo/autoconsent/pull/710) ([@noisysocks](https://github.com/noisysocks))
38
+ - Fix HTML formatting for task list in release notes [#705](https://github.com/duckduckgo/autoconsent/pull/705) ([@noisysocks](https://github.com/noisysocks))
39
+
40
+ #### ⚠️ Pushed to `main`
41
+
42
+ - Try main branch of native-github-asana-sync ([@noisysocks](https://github.com/noisysocks))
43
+ - Try a different build of native-github-asana-sync ([@noisysocks](https://github.com/noisysocks))
44
+ - Try different build of native-github-asana-sync ([@noisysocks](https://github.com/noisysocks))
45
+
46
+ #### Authors: 4
47
+
48
+ - [@dependabot[bot]](https://github.com/dependabot[bot])
49
+ - [@github-actions[bot]](https://github.com/github-actions[bot])
50
+ - Robert Anderson ([@noisysocks](https://github.com/noisysocks))
51
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
52
+
53
+ ---
54
+
1
55
  # v12.16.0 (Tue Mar 25 2025)
2
56
 
3
57
  #### 🚀 Enhancement
package/Jenkinsfile CHANGED
@@ -1,9 +1,10 @@
1
- def runPlaywrightTests(resultDir, browser, grep) {
1
+ def runPlaywrightTests(resultDir, browser, testFiles) {
2
2
  try {
3
3
  timeout(120) {
4
+ def testFilesArg = testFiles.join(' ')
4
5
  sh """
5
6
  rm -f results.xml
6
- PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test tests/_sample-test.spec.ts --project $browser --reporter=junit --grep "$grep"|| true
7
+ PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test ${testFilesArg} --project ${browser} --reporter=junit || true
7
8
  """
8
9
  }
9
10
  } finally {
@@ -19,13 +20,46 @@ def withEnvFile(envfile, Closure cb) {
19
20
  }
20
21
  }
21
22
 
23
+ def getModifiedFiles() {
24
+ if (env.CHANGE_ID) {
25
+ def changedFiles = sh(script: "git diff --name-only origin/${env.CHANGE_TARGET} HEAD", returnStdout: true).trim()
26
+ return changedFiles.split("\n")
27
+ } else {
28
+ return []
29
+ }
30
+ }
31
+
32
+ def getTestsToRun(modifiedFiles) {
33
+ def testsToRun = []
34
+
35
+ // Run any modified test files
36
+ for (file in modifiedFiles) {
37
+ if (file.startsWith("tests/") && file.endsWith(".spec.ts")) {
38
+ testsToRun.add(file)
39
+ }
40
+ }
41
+
42
+ // Run the corresponding test file for any modified rule file
43
+ for (file in modifiedFiles) {
44
+ if (file.startsWith("rules/autoconsent/") && file.endsWith(".json")) {
45
+ def fileName = file.substring("rules/autoconsent/".length())
46
+ def baseName = fileName.substring(0, fileName.lastIndexOf(".json"))
47
+ def testFile = "tests/${baseName}.spec.ts"
48
+
49
+ if (fileExists(testFile) && !testsToRun.contains(testFile)) {
50
+ testsToRun.add(testFile)
51
+ }
52
+ }
53
+ }
54
+
55
+ return testsToRun
56
+ }
57
+
22
58
  pipeline {
23
59
  agent { label 'autoconsent-crawler' }
24
60
  parameters {
25
61
  string(name: 'TEST_RESULT_ROOT', defaultValue: '/mnt/efs/users/smacbeth/autoconsent/ci', description: 'Where test results and configuration are stored')
26
62
  choice(name: 'BROWSER', choices: ['chrome', 'webkit', 'iphoneSE', 'firefox'], description: 'Browser')
27
- string(name: 'GREP', defaultValue: '', description: 'filter for tests matching a specific string')
28
- string(name: 'NSITES', defaultValue: '1', description: 'number of sites to test per CMP')
29
63
  string(name: 'BRANCH', defaultValue: 'main', description: 'Branch or PR to checkout (e.g. pr/123)')
30
64
  }
31
65
  environment {
@@ -44,10 +78,10 @@ pipeline {
44
78
  steps {
45
79
  checkout([$class: 'GitSCM', branches: [[name: "${params.BRANCH}"]],
46
80
  extensions: [[$class: 'LocalBranch']],
47
- userRemoteConfigs: [[refspec: "+refs/pull/*/head:refs/remotes/origin/pr/*", credentialsId: 'GitHubAccess', url: 'https://github.com/duckduckgo/autoconsent.git']]])
81
+ userRemoteConfigs: [[refspec: "+refs/pull/*/head:refs/remotes/origin/pr/*", credentialsId: 'autoconsent-rw', url: 'https://github.com/duckduckgo/autoconsent.git']]])
48
82
  }
49
83
  }
50
-
84
+
51
85
  stage('Build') {
52
86
  steps {
53
87
  sh '''
@@ -63,13 +97,22 @@ pipeline {
63
97
  }
64
98
  }
65
99
  }
66
-
100
+
67
101
  stage('Test') {
68
102
  steps {
69
- script {
103
+ script {
70
104
  def testsFailed = 0
71
105
  def testsTotal = 0
72
- withEnv(["NSITES=${params.NSITES}}"]) {
106
+
107
+ def modifiedFiles = getModifiedFiles()
108
+ echo "Modified files: ${modifiedFiles.join(', ')}"
109
+
110
+ def testsToRun = getTestsToRun(modifiedFiles)
111
+ echo "Tests to run: ${testsToRun.join(', ')}"
112
+
113
+ if (testsToRun.isEmpty()) {
114
+ echo "No tests to run for this change"
115
+ } else {
73
116
  def testEnvs = [
74
117
  "${params.TEST_RESULT_ROOT}/de.env",
75
118
  "${params.TEST_RESULT_ROOT}/us.env",
@@ -77,19 +120,32 @@ pipeline {
77
120
  ]
78
121
  for (testEnv in testEnvs) {
79
122
  withEnvFile(testEnv) {
80
- def summary = runPlaywrightTests(params.TEST_RESULT_ROOT, params.BROWSER, params.GREP)
123
+ def summary = runPlaywrightTests(params.TEST_RESULT_ROOT, params.BROWSER, testsToRun)
81
124
  testsFailed += summary.failCount
82
125
  testsTotal += summary.totalCount
83
126
  }
84
- }
127
+ }
128
+ }
129
+
130
+ def status = 'SUCCESS'
131
+ def description = "No tests to run"
132
+
133
+ if (testsTotal > 0) {
134
+ description = "${testsFailed}/${testsTotal} failed"
135
+ if (testsFailed > 0) {
136
+ status = 'FAILURE'
137
+ }
85
138
  }
139
+
86
140
  githubNotify(
87
- account: 'duckduckgo',
88
- repo: 'autoconsent',
89
- context: 'Tests / Coverage sample',
90
- sha: "${env.GIT_COMMIT}",
91
- description: "${testsFailed}/${testsTotal} failed",
92
- status: testsFailed > 50 ? 'FAILURE' : 'SUCCESS')
141
+ account: 'duckduckgo',
142
+ repo: 'autoconsent',
143
+ context: 'Tests / Changed files',
144
+ sha: "${env.GIT_COMMIT}",
145
+ description: description,
146
+ status: status,
147
+ credentialsId: 'autoconsent-rw'
148
+ )
93
149
  }
94
150
  }
95
151
  }
@@ -112,9 +112,9 @@ const processReleaseTasks = async () => {
112
112
  return '';
113
113
  }
114
114
 
115
- let taskListHtml = '<strong>Tasks included in this release:</strong>\n<ul>';
115
+ let taskListHtml = '<strong>Tasks included in this release:</strong>\n<ul>\n';
116
116
  for (const task of tasks) {
117
- taskListHtml += getLink(task.permalink_url) + '\n';
117
+ taskListHtml += '<li>' + getLink(task.permalink_url) + '</li>\n';
118
118
  await asana.tasks.updateTask(task.gid, { completed: true });
119
119
  }
120
120
  taskListHtml += '</ul>';