Skip to content

Commit 6eeae80

Browse files
authored
feat: bootstrap 5 and html5 validation
2 parents 902e37d + fd6c98b commit 6eeae80

1,538 files changed

Lines changed: 55958 additions & 192932 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
"containerEnv": {
1111
"EDITOR_VSCODE": "true"
1212
},
13+
14+
"features": {
15+
"docker-in-docker": {
16+
"version": "latest"
17+
},
18+
"github-cli": "latest"
19+
},
1320

1421
// Set *default* container specific settings.json values on container create.
1522
"settings": {

.devcontainer/docker-compose.extend.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ services:
77
volumes:
88
- .:/workspace
99
- /workspace/node_modules
10+
- /workspace/.parcel-cache
11+
- /workspace/__pycache__
1012
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
1113
network_mode: service:db

.editorconfig

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,39 @@
44

55
root = true
66

7-
# Settings for IETF datatracker
7+
# Global settings for IETF datatracker
88
# ---------------------------------------------------------
99
# PEP8 Style
1010

1111
[*]
12-
indent_style = space
1312
indent_size = 4
14-
end_of_line = lf
13+
indent_style = space
1514
charset = utf-8
16-
# to avoid tripping Henrik's commit hook:
1715
trim_trailing_whitespace = false
18-
insert_final_newline = false
16+
insert_final_newline = true
17+
18+
# Specializations below *add to* the above defaults
1919

2020
# Settings for .github folder
2121
# ---------------------------------------------------------
2222
# GitHub Markdown Style
2323

2424
[.github/**]
25-
indent_style = space
2625
indent_size = 2
27-
end_of_line = lf
28-
charset = utf-8
29-
trim_trailing_whitespace = false
30-
insert_final_newline = true
3126

3227
# Settings for client-side JS / Vue files
3328
# ---------------------------------------------------------
3429
# StandardJS Style
3530

3631
[client/**]
37-
indent_style = space
3832
indent_size = 2
39-
end_of_line = lf
40-
charset = utf-8
41-
trim_trailing_whitespace = true
42-
insert_final_newline = true
4333

4434
[package.json]
45-
indent_style = space
4635
indent_size = 2
47-
end_of_line = lf
48-
charset = utf-8
49-
trim_trailing_whitespace = true
50-
insert_final_newline = true
5136

5237
# Settings for cypress tests
5338
# ---------------------------------------------------------
5439
# StandardJS Style
5540

5641
[cypress/**]
57-
indent_style = space
5842
indent_size = 2
59-
end_of_line = lf
60-
charset = utf-8
61-
trim_trailing_whitespace = true
62-
insert_final_newline = true

.eslintrc.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
module.exports = {
2+
extends: ["eslint:recommended"],
23
rules: {
3-
indent: [2, 4],
4-
camelcase: 0,
5-
"require-jsdoc": 0,
6-
quotes: [2, "double"],
7-
"no-multiple-empty-lines": [2, {max: 2}],
8-
"quote-props": [2, "as-needed"],
9-
"brace-style": [2, "1tbs", {allowSingleLine: true}]
4+
indent: ["error", 4],
5+
quotes: "off",
6+
"no-multiple-empty-lines": ["error", { max: 2, maxEOF: 0 }],
7+
"quote-props": ["error", "as-needed"],
8+
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
9+
semi: ["error", "always"],
10+
"newline-per-chained-call": ["error"]
1011
},
1112
env: {
1213
browser: true,
13-
jquery: true
14+
jquery: true,
15+
node: true
1416
},
1517
globals: {
1618
d3: true
1719
},
18-
extends: "google"
19-
};
20+
parserOptions: {
21+
sourceType: "module",
22+
ecmaVersion: 2015
23+
}
24+
};

.github/workflows/build-test-base.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths:
99
- 'package.json'
1010
- 'requirements.txt'
11+
- 'dev/tests/Dockerfile'
1112

1213
workflow_dispatch:
1314

@@ -31,6 +32,6 @@ jobs:
3132
image: ${{ env.IMAGE_NAME }}
3233
tags: latest
3334
registry: ${{ env.REGISTRY }}
34-
dockerfile: dev/docker-test-base/Dockerfile
35+
dockerfile: dev/tests/Dockerfile
3536
username: ${{ github.actor }}
3637
password: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build.yml

Lines changed: 139 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,33 @@ on:
1111
description: 'Create Production Release'
1212
required: true
1313
type: boolean
14+
skiptests:
15+
description: 'Skip Tests'
16+
required: true
17+
type: boolean
18+
summary:
19+
description: 'Summary'
20+
required: false
21+
type: string
22+
default: ''
1423

1524
jobs:
16-
publish:
25+
# -----------------------------------------------------------------
26+
# PREPARE
27+
# -----------------------------------------------------------------
28+
prepare:
29+
name: Prepare Release
1730
runs-on: ubuntu-latest
31+
outputs:
32+
should_deploy: ${{ steps.buildvars.outputs.should_deploy }}
33+
pkg_version: ${{ steps.buildvars.outputs.pkg_version }}
34+
pkg_version_strict: ${{ steps.buildvars.outputs.pkg_version_strict }}
1835

1936
steps:
2037
- uses: actions/checkout@v2
2138
with:
2239
fetch-depth: 0
23-
40+
2441
- name: Get Next Version
2542
if: ${{ github.event.inputs.publish == 'true' }}
2643
id: semver
@@ -49,26 +66,103 @@ jobs:
4966
token: ${{ secrets.GITHUB_TOKEN }}
5067

5168
- name: Set Build Variables
69+
id: buildvars
5270
run: |
5371
if [[ $NEXT_VERSION ]]; then
5472
echo "Using AUTO SEMVER mode: $NEXT_VERSION"
55-
echo "SHOULD_DEPLOY=true" >> $GITHUB_ENV
56-
echo "PKG_VERSION=$NEXT_VERSION" >> $GITHUB_ENV
57-
echo "PKG_VERSION_STRICT=${NEXT_VERSION#?}" >> $GITHUB_ENV
73+
echo "::set-output name=should_deploy::true"
74+
echo "::set-output name=pkg_version::$NEXT_VERSION"
75+
echo "::set-output name=pkg_version_strict::${NEXT_VERSION#?}"
5876
echo "::notice::Release created using branch $GITHUB_REF_NAME"
5977
elif [[ "$GITHUB_REF" =~ ^refs/tags/v* ]]; then
6078
echo "Using TAG mode: $GITHUB_REF_NAME"
61-
echo "SHOULD_DEPLOY=true" >> $GITHUB_ENV
62-
echo "PKG_VERSION=$GITHUB_REF_NAME" >> $GITHUB_ENV
63-
echo "PKG_VERSION_STRICT=${GITHUB_REF_NAME#?}" >> $GITHUB_ENV
79+
echo "::set-output name=should_deploy::true"
80+
echo "::set-output name=pkg_version::$GITHUB_REF_NAME"
81+
echo "::set-output name=pkg_version_strict::${GITHUB_REF_NAME#?}"
6482
echo "::notice::Release created using tag $GITHUB_REF_NAME"
6583
else
6684
echo "Using TEST mode: v7.0.0-dev.$GITHUB_RUN_NUMBER"
67-
echo "SHOULD_DEPLOY=false" >> $GITHUB_ENV
68-
echo "PKG_VERSION=v3.0.0-dev.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
69-
echo "PKG_VERSION_STRICT=3.0.0-dev.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
85+
echo "::set-output name=should_deploy::false"
86+
echo "::set-output name=pkg_version::v7.0.0-dev.$GITHUB_RUN_NUMBER"
87+
echo "::set-output name=pkg_version_strict::7.0.0-dev.$GITHUB_RUN_NUMBER"
7088
echo "::notice::Non-production build created using branch $GITHUB_REF_NAME"
7189
fi
90+
91+
# -----------------------------------------------------------------
92+
# TESTS
93+
# -----------------------------------------------------------------
94+
tests:
95+
name: Run Tests
96+
if: ${{ github.event.inputs.skiptests == 'false' }}
97+
needs: [prepare]
98+
runs-on: ubuntu-latest
99+
container: ghcr.io/ietf-tools/datatracker-test-base:latest
100+
101+
services:
102+
db:
103+
image: ghcr.io/ietf-tools/datatracker-db:latest
104+
volumes:
105+
- mariadb-data:/var/lib/mysql
106+
env:
107+
MYSQL_ROOT_PASSWORD: ietf
108+
MYSQL_DATABASE: ietf_utf8
109+
MYSQL_USER: django
110+
MYSQL_PASSWORD: RkTkDPFnKpko
111+
112+
steps:
113+
- uses: actions/checkout@v3
114+
115+
- name: Prepare for tests
116+
run: |
117+
chmod +x ./dev/tests/prepare.sh
118+
sh ./dev/tests/prepare.sh
119+
120+
- name: Ensure DB is ready
121+
run: |
122+
/usr/local/bin/wait-for db:3306 -- echo "DB ready"
123+
124+
- name: Run all tests
125+
run: |
126+
echo "Running checks..."
127+
./ietf/manage.py check
128+
echo "Running tests..."
129+
./ietf/manage.py test --settings=settings_sqlitetest
130+
coverage xml
131+
132+
- name: Upload Coverage Results to Codecov
133+
uses: codecov/codecov-action@v2.1.0
134+
with:
135+
files: coverage.xml
136+
137+
- name: Convert Coverage Results
138+
if: ${{ always() }}
139+
run: |
140+
mv latest-coverage.json coverage.json
141+
142+
- name: Upload Coverage Results as Build Artifact
143+
uses: actions/upload-artifact@v3.0.0
144+
if: ${{ always() }}
145+
with:
146+
name: coverage
147+
path: coverage.json
148+
149+
# -----------------------------------------------------------------
150+
# RELEASE
151+
# -----------------------------------------------------------------
152+
release:
153+
name: Make Release
154+
if: ${{ always() }}
155+
needs: [tests, prepare]
156+
runs-on: ubuntu-latest
157+
env:
158+
SHOULD_DEPLOY: ${{needs.prepare.outputs.should_deploy}}
159+
PKG_VERSION: ${{needs.prepare.outputs.pkg_version}}
160+
PKG_VERSION_STRICT: ${{needs.prepare.outputs.pkg_version_strict}}
161+
162+
steps:
163+
- uses: actions/checkout@v2
164+
with:
165+
fetch-depth: 0
72166

73167
- name: Setup Node.js
74168
uses: actions/setup-node@v3.0.0
@@ -80,17 +174,27 @@ jobs:
80174
with:
81175
python-version: '3.x'
82176

177+
- name: Download a Coverage Results
178+
if: ${{ github.event.inputs.skiptests == 'false' }}
179+
uses: actions/download-artifact@v3.0.0
180+
with:
181+
name: coverage
182+
83183
- name: Make Release Build
84184
env:
85185
DEBIAN_FRONTEND: noninteractive
86186
run: |
187+
echo "PKG_VERSION: $PKG_VERSION"
188+
echo "PKG_VERSION_STRICT: $PKG_VERSION_STRICT"
189+
echo "GITHUB_SHA: $GITHUB_SHA"
190+
echo "GITHUB_REF_NAME: $GITHUB_REF_NAME"
87191
echo "Running build script..."
88192
chmod +x ./dev/deploy/build.sh
89193
sh ./dev/deploy/build.sh
90194
echo "Setting version $PKG_VERSION_STRICT..."
91-
sed -i -r -e "s/^__version__ += '.*'$/__version__ = '$PKG_VERSION_STRICT'/" ietf/__init__.py
92-
sed -i -r -e "s/^__release_hash__ += '.*'$/__release_hash__ = '$GITHUB_SHA'/" ietf/__init__.py
93-
sed -i -r -e "s/^__release_branch__ += '.*'$/__release_branch__ = '$GITHUB_REF_NAME'/" ietf/__init__.py
195+
sed -i -r -e "s|^__version__ += '.*'$|__version__ = '$PKG_VERSION_STRICT'|" ietf/__init__.py
196+
sed -i -r -e "s|^__release_hash__ += '.*'$|__release_hash__ = '$GITHUB_SHA'|" ietf/__init__.py
197+
sed -i -r -e "s|^__release_branch__ += '.*'$|__release_branch__ = '$GITHUB_REF_NAME'|" ietf/__init__.py
94198
echo "Build release tarball..."
95199
mkdir -p /home/runner/work/release
96200
tar -czf /home/runner/work/release/release.tar.gz -X dev/deploy/exclude-patterns.txt .
@@ -103,6 +207,25 @@ jobs:
103207
token: ${{ github.token }}
104208
tag: ${{ env.PKG_VERSION }}
105209
writeToFile: false
210+
211+
- name: Prepare Coverage Action
212+
if: ${{ github.event.inputs.skiptests == 'false' }}
213+
working-directory: ./dev/coverage-action
214+
run: npm install
215+
216+
- name: Process Coverage Stats + Chart
217+
id: covprocess
218+
uses: ./dev/coverage-action/
219+
if: ${{ github.event.inputs.skiptests == 'false' }}
220+
with:
221+
token: ${{ github.token }}
222+
tokenCommon: ${{ secrets.GH_COMMON_TOKEN }}
223+
repoCommon: common
224+
version: ${{needs.prepare.outputs.pkg_version}}
225+
changelog: ${{ steps.changelog.outputs.changes }}
226+
summary: ${{ github.event.inputs.summary }}
227+
coverageResultsPath: coverage.json
228+
histCoveragePath: historical-coverage.json
106229

107230
- name: Create Release
108231
uses: ncipollo/release-action@v1
@@ -112,8 +235,8 @@ jobs:
112235
draft: false
113236
tag: ${{ env.PKG_VERSION }}
114237
name: ${{ env.PKG_VERSION }}
115-
body: ${{ steps.changelog.outputs.changes }}
116-
artifacts: "/home/runner/work/release/release.tar.gz"
238+
body: ${{ steps.covprocess.outputs.changelog }}
239+
artifacts: "/home/runner/work/release/release.tar.gz,coverage.json,historical-coverage.json"
117240
token: ${{ secrets.GITHUB_TOKEN }}
118241

119242
- name: Upload Build Artifacts

0 commit comments

Comments
 (0)