Skip to content

Commit 9a3e695

Browse files
authored
Revert yarn migration (#1238)
* Revert "Improve CI (#1233)" This reverts commit b728c18. * Revert "chore: revert to using npm version directly (#1227)" This reverts commit 414d0cc. * Revert "AXON-1209: Migration: npm → Yarn v4 (Berry) (#1024)" This reverts commit a219aa4.
1 parent 006df90 commit 9a3e695

File tree

18 files changed

+48301
-26865
lines changed

18 files changed

+48301
-26865
lines changed

.audit-ci.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"package-manager": "npm",
3+
"low": true,
4+
"allowlist": [
5+
"pdfjs-dist"
6+
],
7+
"show-not-found": true
8+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ In particular, if you're making changes not covered by tests - please describe t
2929

3030
Basic checks:
3131

32-
- [ ] `yarn lint`
33-
- [ ] `yarn test`
32+
- [ ] `npm run lint`
33+
- [ ] `npm run test`
3434

3535
Advanced checks:
3636
- [ ] If Atlassian employee & Bitbucket changes: did you test with DC in mind? [See Instructions](https://www.loom.com/share/71e5d17734a547f68fd6128be6cd760e?sid=835e58a7-1240-498d-b2d7-fa7fdf8ffa36)

.github/actions/setup-dependencies/action.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 47 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -18,56 +18,39 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4
21-
22-
- name: Setup Yarn dependencies
23-
uses: ./.github/actions/setup-dependencies
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: |
28+
npm ci --no-audit
2429
2530
- name: Run vulnerability audit
26-
run: yarn npm audit --recursive --no-deprecations
31+
# "There is no Vulnerability in Media Viewer after 48.5.4. since it was fixed by patching, but npm audit still reports it.",
32+
# So that switched to audit-ci with allowlist
33+
run: npx audit-ci --config=".audit-ci.json"
2734

2835
- name: Run linter
29-
run: yarn lint
36+
run: npm run lint
3037

31-
build:
32-
runs-on: ubuntu-latest
33-
steps:
34-
- uses: actions/checkout@v4
35-
36-
- name: Setup Yarn dependencies
37-
uses: ./.github/actions/setup-dependencies
38-
39-
- name: Build and package the extension
40-
run: yarn extension:package
41-
42-
- name: Upload extension package
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: extension-package
46-
path: atlascode-*.vsix
47-
retention-days: 1
48-
49-
test-unit:
50-
runs-on: ubuntu-latest
51-
steps:
52-
- uses: actions/checkout@v4
53-
54-
- name: Setup Yarn dependencies
55-
uses: ./.github/actions/setup-dependencies
56-
57-
- name: Run unit tests
58-
run: yarn test
59-
60-
test-e2e:
61-
needs: [build]
38+
ci-matrix:
39+
needs: [lint]
6240
runs-on: ubuntu-latest
6341
strategy:
6442
fail-fast: true
6543
matrix:
66-
target:
67-
- jira-cloud
68-
- jira-dc
69-
- bitbucket-cloud
70-
- bitbucket-dc
44+
include:
45+
- kind: unit
46+
- kind: e2e
47+
target: jira-cloud
48+
- kind: e2e
49+
target: jira-dc
50+
- kind: e2e
51+
target: bitbucket-cloud
52+
- kind: e2e
53+
target: bitbucket-dc
7154

7255
env:
7356
ATLASCODE_FX3_API_KEY: ${{ secrets.ATLASCODE_FX3_API_KEY }}
@@ -77,30 +60,40 @@ jobs:
7760

7861
steps:
7962
- uses: actions/checkout@v4
80-
81-
- name: Setup Yarn dependencies
82-
uses: ./.github/actions/setup-dependencies
83-
84-
- name: Download extension package
85-
uses: actions/download-artifact@v4
63+
- uses: actions/setup-node@v4
8664
with:
87-
name: extension-package
65+
node-version: 20
66+
cache: 'npm'
67+
68+
- name: Install dependencies
69+
run: npm ci --no-audit
70+
71+
- name: Run unit tests
72+
if: matrix.kind == 'unit'
73+
run: npm run test
74+
75+
- name: Build and package the extension
76+
if: matrix.kind == 'e2e'
77+
run: npm run extension:package
8878

8979
- name: Generate SSL certs for E2E test
90-
run: yarn test:e2e:sslcerts
80+
if: matrix.kind == 'e2e'
81+
run: npm run test:e2e:sslcerts
9182

9283
- name: Fetch E2E image
84+
if: matrix.kind == 'e2e'
9385
run: |
9486
docker pull ghcr.io/atlassian/atlascode-e2e:latest
9587
docker tag ghcr.io/atlassian/atlascode-e2e:latest atlascode-e2e
9688
9789
- name: Run E2E (${{ matrix.target }})
98-
run: yarn test:e2e:docker
90+
if: matrix.kind == 'e2e'
91+
run: npm run test:e2e:docker
9992
env:
10093
TARGET: ${{ matrix.target }}
10194

10295
- name: Upload E2E artifacts (${{ matrix.target }})
103-
if: failure()
96+
if: matrix.kind == 'e2e' && failure()
10497
uses: actions/upload-artifact@v4
10598
with:
10699
name: e2e-test-results-${{ matrix.target }}
@@ -109,22 +102,14 @@ jobs:
109102
if-no-files-found: ignore
110103

111104
finalize:
112-
needs: [lint, test-unit, test-e2e]
105+
needs: [ci-matrix]
113106
runs-on: ubuntu-latest
114107
if: always()
115108
steps:
116109
- name: Check if all jobs succeeded
117110
run: |
118-
if [[ "${{ needs.lint.result }}" != "success" ]]; then
119-
echo "Lint job failed"
120-
exit 1
121-
fi
122-
if [[ "${{ needs.test-unit.result }}" != "success" ]]; then
123-
echo "Unit test job failed"
124-
exit 1
125-
fi
126-
if [[ "${{ needs.test-e2e.result }}" != "success" ]]; then
127-
echo "E2E test jobs failed"
111+
if [[ "${{ needs.ci-matrix.result }}" != "success" ]]; then
112+
echo "One of the ci-matrix jobs failed"
128113
exit 1
129114
fi
130115
echo "All steps completed successfully"

.github/workflows/release-nightly.yaml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,25 @@ jobs:
3636
uses: actions/setup-node@v4
3737
with:
3838
node-version: 20
39-
40-
- name: Enable Corepack
41-
run: corepack enable
42-
43-
- name: Cache Yarn dependencies
44-
uses: actions/cache@v4
45-
with:
46-
path: .yarn/cache
47-
key: yarn-cache-${{ hashFiles('yarn.lock') }}
48-
restore-keys: yarn-cache-
39+
cache: 'npm'
4940

5041
- name: Set version in package.json
5142
run: npm version $PACKAGE_VERSION --no-git-tag-version --allow-same-version -f
5243

5344
- name: Install dependencies
54-
run: yarn install --immutable
45+
run: npm ci --no-audit
5546

5647
- name: Build and package the extension for pre-release
57-
run: yarn extension:package:prerelease
48+
run: npm run extension:package:prerelease
5849

5950
- name: Run linter
60-
run: yarn lint
51+
run: npm run lint
6152

6253
- name: Run unit tests
63-
run: yarn test:nocoverage
54+
run: npm run test:nocoverage
6455

6556
- name: Generate SSL certs for E2E test
66-
run: yarn test:e2e:sslcerts
57+
run: npm run test:e2e:sslcerts
6758

6859
- name: Fetch E2E image
6960
run: |

.github/workflows/release.yaml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,25 @@ jobs:
4343
uses: actions/setup-node@v4
4444
with:
4545
node-version: 20
46-
47-
- name: Enable Corepack
48-
run: corepack enable
49-
50-
- name: Cache Yarn dependencies
51-
uses: actions/cache@v4
52-
with:
53-
path: .yarn/cache
54-
key: yarn-cache-${{ hashFiles('yarn.lock') }}
55-
restore-keys: yarn-cache-
46+
cache: 'npm'
5647

5748
- name: Set version in package.json
5849
run: npm version $PACKAGE_VERSION --no-git-tag-version --allow-same-version -f
5950

6051
- name: Install dependencies
61-
run: yarn install --immutable
52+
run: npm ci --no-audit
6253

6354
- name: Build and package the extension
64-
run: yarn extension:package
55+
run: npm run extension:package
6556

6657
- name: Run linter
67-
run: yarn lint
58+
run: npm run lint
6859

6960
- name: Run unit tests
70-
run: yarn test:nocoverage
61+
run: npm run test:nocoverage
7162

7263
- name: Generate SSL certs for E2E test
73-
run: yarn test:e2e:sslcerts
64+
run: npm run test:e2e:sslcerts
7465

7566
- name: Fetch E2E image
7667
run: |

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@ node_modules
77
launch.json
88
*.vsix
99
.yo-*
10-
11-
.yarn/cache
12-
.yarn/unplugged
13-
.yarn/build-state.yml
14-
.yarn/install-state.gz
1510
yarn-error.log
16-
1711
*.pem
1812
*.crt
1913
*.p12

.vscode/launch.json.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"envFile": "${workspaceFolder}/.env"
2121
},
2222
{
23-
// This configuration requires yarn dev to be running externally
23+
// This configuration requires npm run dev to be running externally
2424
// It will pick up the re-compiled extension code but not hot-swap it
2525
"name": "Extension (watch/external)",
2626
"type": "extensionHost",

0 commit comments

Comments
 (0)