@suffolklitlab/alkiln 5.10.4 → 5.11.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.
@@ -2,7 +2,6 @@ name: GitHub server installation
2
2
 
3
3
  on:
4
4
  push:
5
- # Default "opened", "reopened", "synchronize". "edited" fires when the PR title gets edited, etc.
6
5
  pull_request:
7
6
  workflow_dispatch:
8
7
  inputs:
@@ -14,7 +13,7 @@ on:
14
13
  default: false
15
14
  type: boolean
16
15
  description: 'Show the docker logs while building the GitHub server container. It will also save the docker log artifact. This might show sensitive config information.'
17
- #### Developer note: You probably don't need this
16
+ #### Developer note: You can probably leave this out
18
17
  enable_tmate:
19
18
  type: boolean
20
19
  description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
@@ -24,44 +23,60 @@ on:
24
23
  jobs:
25
24
 
26
25
  github-server-tests:
26
+ #### Developer note: If under `on` (above) you have both `push` and
27
+ #### `pull_request`, this avoids running double tests when someone
28
+ #### on the team makes a pull request
29
+ # 1: Trigger job on push or dispatch from this repository
30
+ # 2: Trigger job on pull request from a fork
31
+ if: (
32
+ github.event_name != 'pull_request'
33
+ && ! github.event.pull_request.head.repo.fork
34
+ ) || (
35
+ github.event_name == 'pull_request'
36
+ && github.event.pull_request.head.repo.fork
37
+ )
27
38
  runs-on: ubuntu-latest
28
39
  strategy:
29
40
  matrix:
30
- node-version: [18.x]
41
+ node-version: [20.x]
31
42
 
43
+ #### Developer note: You can probably leave out these specific
44
+ #### environment variables. You may not even need the `env`
45
+ #### keyword or values at all. See
46
+ #### https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/alkiln/writing#env-vars
32
47
  env:
33
48
  SECRET_VAR1: secret-var1-value
34
49
  SECRET_VAR2: secret-var2-value
35
50
  SECRET_FOR_MISSING_FIELD: secret for missing field
36
51
 
37
52
  steps:
38
- #### Developer note: You probably don't need this
39
53
  # Place the root directory in this branch to access
40
54
  # relative paths to action files
41
- - uses: actions/checkout@v3
55
+ - uses: actions/checkout@v4
42
56
 
43
57
  - name: ALKiln - Start the isolated temporary docassemble server on GitHub
44
58
  id: github_server
45
- #### Developer note: you'll need to replace `.` with the path to ALKiln’s
46
- #### repo and branch. For example, for version 5, put
47
- #### suffolkLITLab/ALKiln/action_for_github_server@v5
48
- #### Come back and update this version later if you want the latest
59
+ #### Developer note: you'll need to replace `uses: ./action_for_github_server`
60
+ #### with the path to ALKiln’s repository name and branch name. For example,
61
+ #### for version 5, use the branch name `v5`:
62
+ #### `uses: suffolkLITLab/ALKiln/action_for_github_server@v5`
49
63
  uses: ./action_for_github_server
50
64
  with:
51
- CONFIG_CONTENTS: "${{ secrets.CONFIG_CONTENTS }}"
52
- #### Developer note: Set this to true to show docker logs and
65
+ #### Developer note: Set this to "true" to show docker logs and
53
66
  #### allow ALKiln to create the docker logs output artifact.
54
67
  SHOW_DOCKER_OUTPUT: "${{ github.event.inputs.show_docker_output }}"
68
+ #### Developer note: You can probably leave this out
69
+ CONFIG_CONTENTS: "${{ secrets.CONFIG_CONTENTS }}"
55
70
  - run: echo "ALKiln finished starting the isolated GitHub docassemble server"
56
71
  shell: bash
57
72
 
58
- #### Developer note: You probably don't need this
59
- # Optional debugging to explore things like config issues
73
+ #### Developer note: You can probably leave this out
74
+ # Optional debugging to explore things like docker issues
60
75
  - name: Docker debug tmate session
61
76
  if: ${{ github.event.inputs.enable_tmate }}
62
77
  uses: mxschmitt/action-tmate@v3
63
78
 
64
- #### Developer note: You probably don't need this
79
+ #### Developer note: You can probably leave this out
65
80
  - name: Run ALKiln - Env vars for our own tests from server output
66
81
  run: |
67
82
  echo "USER1_EMAIL=${{ steps.github_server.outputs.DA_ADMIN_EMAIL }}" >> $GITHUB_ENV
@@ -78,18 +93,25 @@ jobs:
78
93
 
79
94
  - name: "Run ALKiln tests"
80
95
  if: ${{ success() }}
81
- #### Developer note: you'll need to replace `.` with the path to ALKiln’s
82
- #### repo and branch and leave off the trailing `/`
83
- #### For example, for version 5 put suffolkLITLab/ALKiln@v5
84
- #### Come back and update this version later if you want the latest
96
+ #### Developer note: you'll need to replace `uses: ./`
97
+ #### with the path to ALKiln’s repository name and branch name. For example,
98
+ #### for version 5, use the branch name `v5`: `uses: suffolkLITLab/ALKiln@v5`
85
99
  uses: ./
100
+ #### Developer note: You can probably leave this out
101
+ env:
102
+ ALKILN_TAG_EXPRESSION: "${{ (github.event.inputs.tags && format('{0}', github.event.inputs.tags)) || 'not @a11y' }}"
86
103
  with:
104
+ #### Developer note: Required inputs. See
105
+ #### https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/alkiln/writing/#sandbox-inputs
87
106
  SERVER_URL: "${{ steps.github_server.outputs.SERVER_URL }}"
88
107
  DOCASSEMBLE_DEVELOPER_API_KEY: "${{ steps.github_server.outputs.DOCASSEMBLE_DEVELOPER_API_KEY }}"
89
108
  INSTALL_METHOD: "server"
90
- #### Developer note: Useful for temporarily shortening ALKiln tests
91
- #### to debug the docker install step
92
- #### Use a "tag expression" to specify which tagged tests to run (https://cucumber.io/docs/cucumber/api/#tag-expressions)
93
- # ALKILN_TAG_EXPRESSION: @a_tag_expression
94
- ALKILN_VERSION: url
109
+ #### Developer note: See https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/alkiln/writing/#optional-inputs
110
+ #### You can probably leave this out
111
+ # Internal: docassemble changes sometimes break @a11y tests. That is
112
+ # a da problem, not ours. We will trigger these tests manually when we
113
+ # want to check up on this.
114
+ ALKILN_TAG_EXPRESSION: $ALKILN_TAG_EXPRESSION
115
+ #### Developer note: You can probably leave this out
116
+ # ALKILN_VERSION: url
95
117
 
@@ -0,0 +1,27 @@
1
+ name: "Validate log codes"
2
+
3
+ # Tests error, warning, info, success, and debug log codes to
4
+ # check for things like mistakes in the numbering of the codes.
5
+ # For example, duplicate code numbers or missing code numbers.
6
+
7
+ on:
8
+ push:
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+
13
+ log-code-tests:
14
+ runs-on: ubuntu-latest
15
+
16
+ strategy:
17
+ matrix:
18
+ node-version: [18.x]
19
+
20
+ name: Validate log codes
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-node@v4
24
+ with:
25
+ node-version: ${{ matrix.node-version }}
26
+ - run: npm install
27
+ - run: npm run codes
@@ -2,7 +2,6 @@ name: Playground installation
2
2
 
3
3
  on:
4
4
  push:
5
- # Default: opened, reopened, synchronize. "edited" is not what we want.
6
5
  pull_request:
7
6
  workflow_dispatch:
8
7
  inputs:
@@ -14,18 +13,31 @@ on:
14
13
  jobs:
15
14
 
16
15
  puppeteer-tests:
16
+ #### Developer note: If under `on` (above) you have both `push` and
17
+ #### `pull_request`, this avoids running double tests when someone
18
+ #### editing the repository makes a pull request
19
+ # 1: Trigger job on push or dispatch from this repository
20
+ # 2: Trigger job on pull request from a fork
21
+ if: (
22
+ github.event_name != 'pull_request'
23
+ && ! github.event.pull_request.head.repo.fork
24
+ ) || (
25
+ github.event_name == 'pull_request'
26
+ && github.event.pull_request.head.repo.fork
27
+ )
17
28
  runs-on: ubuntu-latest
18
-
19
29
  strategy:
20
30
  matrix:
21
- node-version: [18.x]
31
+ node-version: [20.x]
22
32
 
23
33
  env:
24
- #### Developer note: Required
34
+ #### Developer note: We recommend turning these into environment
35
+ #### variables before using them as inputs later
25
36
  SERVER_URL: ${{ secrets.SERVER_URL }}
26
37
  DOCASSEMBLE_DEVELOPER_API_KEY: ${{ secrets.DOCASSEMBLE_DEVELOPER_API_KEY }}
27
- #### Developer note: you don't need any of these
28
- # Specific to our repo's tests
38
+
39
+ #### Developer note: You can probably leave out these specific
40
+ #### environment variables.
29
41
  PLAYGROUND_EMAIL: ${{ secrets.PLAYGROUND_EMAIL }}
30
42
  PLAYGROUND_PASSWORD: ${{ secrets.PLAYGROUND_PASSWORD }}
31
43
  PLAYGROUND_ID: ${{ secrets.PLAYGROUND_ID }}
@@ -39,25 +51,32 @@ jobs:
39
51
 
40
52
  name: Run ALKiln tests
41
53
  steps:
42
- #### Developer note: You probably don't need this
43
- # Place the root directory in this branch to access
44
- # relative paths to action files
45
- - uses: actions/checkout@v3
54
+ #### Developer note: You can probably leave this out
55
+ # Place the root directory in this branch to access relative paths to action files
56
+ - uses: actions/checkout@v4
46
57
 
47
58
  - name: Pause between triggers
48
59
  if: (github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork)
49
60
  shell: bash
50
- run: sleep 30
61
+ run: sleep 60
51
62
 
52
- #### Developer note: you'll need to replace `.` with the path to
53
- #### the repo and branch and leave off the trailing `/`
54
- #### For example suffolkLITLab/ALKiln@v5
63
+ #### Developer note: you'll need to replace `uses: ./`
64
+ #### with the path to ALKiln’s repository name and branch name. For example,
65
+ #### for version 5, use the branch name `v5`: `uses: suffolkLITLab/ALKiln@v5`
55
66
  - uses: ./
67
+ #### Developer note: You can probably leave this out
68
+ env:
69
+ ALKILN_TAG_EXPRESSION: "${{ (github.event.inputs.tags && format('{0}', github.event.inputs.tags)) || 'not @a11y' }}"
56
70
  with:
71
+ #### Developer note: Required ALKiln inputs. You can read more at
72
+ #### https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/alkiln/writing/#githubNyou-inputs
57
73
  SERVER_URL: "${{ env.SERVER_URL }}"
58
74
  DOCASSEMBLE_DEVELOPER_API_KEY: "${{ env.DOCASSEMBLE_DEVELOPER_API_KEY }}"
59
- #### Developer note: Useful for temporarily shortening ALKiln tests
60
- #### to debug the docker install step
61
- # ALKILN_TAG_EXPRESSION: @a_tag_expression
62
- #### Developer note: you probalby don't need this
63
- ALKILN_VERSION: url
75
+ #### Developer note: See https://suffolklitlab.org/docassemble-AssemblyLine-documentation/docs/alkiln/writing/#optional-inputs
76
+ #### You can probably leave this out
77
+ # Internal: docassemble changes sometimes break @a11y tests. That is
78
+ # a da problem, not ours. We will trigger these tests manually when we
79
+ # want to check up on this.
80
+ ALKILN_TAG_EXPRESSION: $ALKILN_TAG_EXPRESSION
81
+ #### Developer note: You can probably leave this out
82
+ # ALKILN_VERSION: url
@@ -19,8 +19,8 @@ jobs:
19
19
  # https://www.shell-tips.com/linux/how-to-format-date-and-time-in-linux-macos-and-bash/#how-to-format-a-date-in-bash
20
20
  run: |
21
21
  echo "UNIT_TESTS_ARTIFACT_NAME=_alkiln-misc-$(date +'%Y-%m-%d at %Hh%Mm%Ss' -u)UTC" >> $GITHUB_ENV
22
- - uses: actions/checkout@v3
23
- - uses: actions/setup-node@v3
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-node@v4
24
24
  with:
25
25
  node-version: ${{ matrix.node-version }}
26
26
  - run: npm install
package/CHANGELOG.md CHANGED
@@ -45,6 +45,31 @@ Format:
45
45
 
46
46
  <!-- ## [Unreleased] -->
47
47
 
48
+ ## [5.11] - 2024-04-05
49
+
50
+ ### Added
51
+
52
+ - Add logs for "success" and also non-coded logs for logs that are simply cosmetic - adding a new log to space messages out or show separators.
53
+
54
+ ### Changed
55
+
56
+ - Error messages now contain error codes. See [#730](https://github.com/SuffolkLITLab/ALKiln/issues/730).
57
+ - Removed extra warning from sources path checking. We currently check a bunch of paths to be flexible and forgiving, so almost every test has been get this warning and it can mislead users. Users do still get an error message if we found no paths at all.
58
+
59
+ ### Internal
60
+
61
+ - Added: Added script to validate log codes (error, warning, info, success, debug logs). Check for duplicate codes, with some exceptions for actions. Check for missing codes - removed codes are stored in another file, allowing this test to work properly.
62
+ - Added: The above script also reports what the highest log code is (if tests pass), letting the developer see what log code they can add next when they need to add a new log code.
63
+ - Added: Added code validation tests to package.json `test` script.
64
+ - Change: Added and edited documentation comments to the workflow files
65
+ - Change: Avoid running double tests when someone makes a pull request. See [#869](https://github.com/SuffolkLITLab/ALKiln/issues/869).
66
+ - Change: Made sure tests for testing failure all had the same failure tags. Same for warnings.
67
+ - Change: Added "Fail" to the start of the Scenario descriptions of each test that tests failure.
68
+ - Change: Removed "example" code from bottom of ./action.yml page since we have our own file as an example now.
69
+ - Change: Switch a11y tests to only run manually since docassemble changes sometimes cause our tests to fail (which isn't actually relevant to our tests). This may be a temporary fix
70
+ - Fix: Stopped using ALKiln version "url".
71
+ - Fix: Update dependency action versions. See [#844](https://github.com/SuffolkLITLab/ALKiln/issues/844) and [#871](https://github.com/SuffolkLITLab/ALKiln/issues/871).
72
+
48
73
  ## [5.10.4] - 2024-03-25
49
74
 
50
75
  ### Fixed
package/action.yml CHANGED
@@ -38,10 +38,10 @@ runs:
38
38
  using: "composite"
39
39
  steps:
40
40
  # Place the root directory in this branch
41
- - uses: actions/checkout@v3
41
+ - uses: actions/checkout@v4
42
42
 
43
43
  # Set environment variables
44
- - name: "ALKiln setup info: Set environment variables"
44
+ - name: "💡 ALK0023 INFO: Set environment variables"
45
45
  # Safe input handling. Avoid evaluating in bash.
46
46
  env:
47
47
  BRANCH_PATH: ${{ github.ref }}
@@ -51,8 +51,9 @@ runs:
51
51
  MAX_SECONDS_FOR_SETUP: ${{ inputs.MAX_SECONDS_FOR_SETUP }}
52
52
  SERVER_RELOAD_TIMEOUT_SECONDS: ${{ inputs.SERVER_RELOAD_TIMEOUT_SECONDS }}
53
53
  DOCASSEMBLECLI_VERSION: ${{ inputs.DOCASSEMBLECLI_VERSION }}
54
+ shell: bash
54
55
  run: |
55
- # ALKiln setup info: Set environment variables
56
+ # 💡 ALK0023 INFO: Set environment variables
56
57
  # Human-readable date/time: https://www.shell-tips.com/linux/how-to-format-date-and-time-in-linux-macos-and-bash/#how-to-format-a-date-in-bash
57
58
  echo "ARTIFACT_NAME=alkiln-$(date +'%Y-%m-%d at %Hh%Mm%Ss' -u)UTC" >> $GITHUB_ENV
58
59
  echo "REPO_URL=${{ github.server_url }}/${{ github.repository }}" >> $GITHUB_ENV
@@ -66,100 +67,76 @@ runs:
66
67
  echo "DOCASSEMBLECLI_VERSION=$DOCASSEMBLECLI_VERSION" >> $GITHUB_ENV
67
68
  # Hard-coded internal ALKiln vars
68
69
  echo "_ORIGIN=github" >> $GITHUB_ENV
70
+ - name: "💡 ALK0024 INFO: Confirm environment variables"
69
71
  shell: bash
70
- - name: "ALKiln setup info: confirm environment variables"
71
72
  run: |
72
- # ALKiln setup info: confirm environment variables
73
+ # 💡 ALK0024 INFO: Confirm environment variables
73
74
  echo -e "\nALKiln version is $ALKILN_VERSION\nRepo is $REPO_URL\nBranch ref is $BRANCH_PATH\nMAX_SECONDS_FOR_SETUP is $MAX_SECONDS_FOR_SETUP\nSERVER_RELOAD_TIMEOUT_SECONDS is $SERVER_RELOAD_TIMEOUT_SECONDS\n"
74
- shell: bash
75
75
 
76
76
  # Install
77
- - name: "ALKiln setup info: Install node packages"
78
- uses: actions/setup-node@v3
77
+ - name: "💡 ALK0025 INFO: Install node packages"
78
+ uses: actions/setup-node@v4
79
79
  with:
80
80
  node-version: "18"
81
- - name: Install ALKiln directly from npm
81
+ - name: "💡 ALK0026 INFO: Install ALKiln directly from npm"
82
+ shell: bash
82
83
  run: |
83
- # ALKiln setup info: Install ALKiln directly from npm
84
+ # 💡 ALK0026 INFO: Install ALKiln directly from npm
84
85
  npm install -g "@suffolklitlab/alkiln@$ALKILN_VERSION"
85
- shell: bash
86
86
 
87
87
  # Install on playground
88
88
 
89
89
  # Don't rely on the environment's version of python
90
- - uses: actions/setup-python@v4
90
+ - uses: actions/setup-python@v5
91
91
  if: ${{ inputs.INSTALL_METHOD == 'playground' }}
92
92
  with:
93
93
  python-version: '3.10'
94
- - name: "ALKiln: Create a Project and install the package from GitHub"
94
+ - name: "💡 ALK0027 INFO: Create a Project and install the package from GitHub"
95
95
  if: ${{ inputs.INSTALL_METHOD == 'playground' }}
96
+ shell: bash
96
97
  run: |
97
- # ALKiln setup info: Create a Project and install the package from GitHub
98
+ # 💡 ALK0027 INFO: Create a Project and install the package from GitHub
98
99
  pip install "docassemblecli==$DOCASSEMBLECLI_VERSION"
99
100
  alkiln-setup
100
- shell: bash
101
- - name: "ALKiln setup ERROR"
102
- run: echo -e "\n\n====\nALKiln ERROR - could not create a project on your server's testing account or pull your package into it. Check the messages above this line.\n\n"
101
+ - name: "😞 ALK0028 ERROR: Unable to create a Project"
103
102
  if: ${{ inputs.INSTALL_METHOD == 'playground' && failure() }}
104
103
  shell: bash
104
+ run: |
105
+ echo -e "\n\n====\n😞 ALK0028 ERROR: Unable to create a Project on your server's testing account or pull your package into it. Check the messages above this line.\n\n"
105
106
 
106
107
  # Server installations - find folders and save session vars
107
- - name: "ALKiln setup info: Install the GitHub package onto the server"
108
+ - name: "💡 ALK0029 INFO: Install the GitHub package onto the server"
108
109
  if: ${{ inputs.INSTALL_METHOD == 'server' }}
109
- run: alkiln-server-install
110
110
  shell: bash
111
- - name: "ALKiln setup ERROR"
112
- run: echo -e "\n\n====\nALKiln ERROR - could not install the package on the temporary GitHub docassemble server. Check the steps above this line.\n\n"
111
+ run: alkiln-server-install
112
+ - name: "😞 ALK0030 ERROR: Unable to install the package"
113
113
  if: ${{ inputs.INSTALL_METHOD == 'server' && failure() }}
114
114
  shell: bash
115
+ run: |
116
+ echo -e "\n\n====\n😞 ALK0030 ERROR: Unable to install the package on the temporary GitHub docassemble server. Check the steps above this line.\n\n"
115
117
 
116
118
  # run tests
117
- - name: "ALKiln info: Run tests"
119
+ - name: "💡 ALK0031 INFO: Run tests"
118
120
  if: ${{ success() }}
119
121
  env:
120
122
  ALKILN_TAG_EXPRESSION: ${{ inputs.ALKILN_TAG_EXPRESSION || github.event.inputs.tags && format('{0}', github.event.inputs.tags) }}
121
- run: alkiln-run $ALKILN_TAG_EXPRESSION
122
123
  shell: bash
124
+ run: alkiln-run $ALKILN_TAG_EXPRESSION
123
125
 
124
126
  # on playground, delete project
125
- - name: "ALKiln info: Try to delete the project from the playground of the docassemble test account."
127
+ - name: "💡 ALK0032 INFO: Delete the Project from the Playground"
126
128
  if: ${{ always() && inputs.INSTALL_METHOD == 'playground' }}
127
129
  run: alkiln-takedown
128
130
  shell: bash
129
131
 
130
132
  # Upload artifacts that subscribers can download on the Actions summary page
131
- - name: "ALKiln info: Upload artifacts folder"
133
+ - name: "💡 ALK0033 INFO: Upload artifacts folder"
132
134
  if: ${{ always() }}
133
- uses: actions/upload-artifact@v3
135
+ uses: actions/upload-artifact@v4
134
136
  with:
135
137
  name: ${{ env.ARTIFACT_NAME }}
136
138
  path: ./alkiln-*
137
139
 
138
- - run: echo "ALkiln finished running tests"
139
- shell: bash
140
-
141
- # ##################################
142
- # # A developer's workflow should look similar to the below.
143
- # # In place of `uses: suffolkLITLab/ALKiln@v5`, they
144
- # # might use another version.
145
- #
146
- # name: ALKiln v5 tests
147
- # on:
148
- # push:
149
- # workflow_dispatch:
150
- # inputs:
151
- # tags:
152
- # description: 'Optional. Use a "tag expression" specify which tagged tests to run. See https://cucumber.io/docs/cucumber/api/#tag-expressions for syntax.'
153
- # default: ''
154
- #
155
- # jobs:
156
- #
157
- # interview-testing:
158
- # runs-on: ubuntu-latest
159
- # name: Run interview tests
160
- # steps:
161
- # - name: Use ALKiln to run tests
162
- # uses: suffolkLITLab/ALKiln@v5
163
- # with:
164
- # SERVER_URL: "${{ secrets.SERVER_URL }}"
165
- # DOCASSEMBLE_DEVELOPER_API_KEY: "${{ secrets.DOCASSEMBLE_DEVELOPER_API_KEY }}"
140
+ - shell: bash
141
+ run: |
142
+ echo "💡 ALK0034 INFO: ALkiln finished running tests"