@suffolklitlab/alkiln 5.13.4 ā 5.15.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.
- package/.github/workflows/github_server.yml +1 -1
- package/.github/workflows/playground.yml +2 -1
- package/.github/workflows/unit_tests.yml +1 -1
- package/CHANGELOG.md +40 -0
- package/action.yml +26 -10
- package/action_for_github_server/action.yml +31 -27
- package/docs/4_environments.md +2 -2
- package/docs/artifacts_folder_name.md +121 -71
- package/docs/constrained_random_tests.md +220 -289
- package/docs/decisions/move_runtime_config_to_sources_folder.md +3 -1
- package/docs/prioritize_constrained_random_tests.md +35 -76
- package/lib/docassemble/server_install.js +0 -2
- package/lib/docassemble/setup.js +1 -3
- package/lib/docassemble/takedown.js +2 -2
- package/lib/globals.js +10 -0
- package/lib/run_cucumber.js +40 -53
- package/lib/scope.js +44 -1
- package/lib/setup/TestGenerator.js +1757 -0
- package/lib/setup/artifacts.js +20 -0
- package/lib/setup/generate.js +42 -0
- package/lib/setup/get_Gherkin_AST.js +26 -0
- package/lib/setup/validate.js +89 -0
- package/lib/steps.js +101 -42
- package/lib/utils/Log.js +317 -165
- package/lib/utils/_alkiln-constrained_random_tests_old.js +1776 -0
- package/lib/utils/get_error_stacks.js +16 -0
- package/lib/utils/reports.js +44 -22
- package/lib/utils/session_vars.js +77 -57
- package/lib/utils/set_sources_paths.js +98 -0
- package/package.json +18 -7
- package/tests/log_codes/check_codes.sh +17 -13
- package/tests/log_codes/log_code_expected_instances.txt +58 -0
- package/tests/unit_tests/constrained_random_answers/invalid.fixtures.js +178 -0
- package/tests/unit_tests/constrained_random_answers/invalid.test.js +251 -0
- package/tests/unit_tests/constrained_random_answers/valid.fixtures.js +957 -0
- package/tests/unit_tests/constrained_random_answers/valid.test.js +563 -0
- package/tests/unit_tests/example_of_chai_test_lifecycle.js +78 -0
- package/tests/unit_tests/log.test.js +17 -41
- package/docs/seprate_file_generation_GitHub_action.md +0 -11
- package/lib/parse.js +0 -36
- package/lib/utils/get_sources_paths.js +0 -162
- package/lib/utils/parse.js +0 -1
- package/lib/utils/proccess_command_line_args.js +0 -267
- /package/docs/{expected_inernal_results.md ā expected_internal_results.md} +0 -0
|
@@ -160,7 +160,7 @@ jobs:
|
|
|
160
160
|
#### Developer note: You can probably leave the rest out
|
|
161
161
|
#### To learn more, see https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#optional-inputs
|
|
162
162
|
ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}"
|
|
163
|
-
# ALKILN_VERSION:
|
|
163
|
+
# ALKILN_VERSION:
|
|
164
164
|
|
|
165
165
|
#### Developer note: Example of making an issue when tests fail
|
|
166
166
|
#### that includes the text of the failure output file
|
|
@@ -76,9 +76,10 @@ jobs:
|
|
|
76
76
|
DOCASSEMBLE_DEVELOPER_API_KEY: "${{ env.DOCASSEMBLE_DEVELOPER_API_KEY }}"
|
|
77
77
|
#### Developer note: See https://assemblyline.suffolklitlab.org/docs/alkiln/writing/#optional-inputs
|
|
78
78
|
#### You can probably leave this out
|
|
79
|
+
ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO: 10
|
|
79
80
|
# Internal: docassemble changes sometimes break @a11y tests. That is
|
|
80
81
|
# a da problem, not ours. We will trigger these tests manually when we
|
|
81
82
|
# want to check up on this.
|
|
82
83
|
ALKILN_TAG_EXPRESSION: "${{ env.ALKILN_TAG_EXPRESSION }}"
|
|
83
84
|
#### Developer note: You can probably leave this out
|
|
84
|
-
# ALKILN_VERSION:
|
|
85
|
+
# ALKILN_VERSION:
|
package/CHANGELOG.md
CHANGED
|
@@ -45,6 +45,46 @@ Format:
|
|
|
45
45
|
|
|
46
46
|
<!-- ## [Unreleased] -->
|
|
47
47
|
|
|
48
|
+
## [5.15.0] - 2025-05-22
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
|
|
52
|
+
- Add the `constrained random answers` Step. You must put the Step in a "constrained random test template" Scenario which goes in a "constrained random test template" file - a `.feature` file that starts with "alkiln_random". The file **MUST have ONLY 1 Scenario per template file** at the moment. The Step is pretty strict. If there are irregularities, it will probably fail, but it will fail quickly. It is flexible about number of tests, though, and will default to 1. Closes [#962](https://github.com/SuffolkLITLab/ALKiln/issues/962).
|
|
53
|
+
- Add `ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO` optional environment variable for the above `constrained random answers` Step. Default value is `40` until we hear otherwise.
|
|
54
|
+
- Regular tests that have incorrect syntax will fail more quickly now - very near the start. So will invalid "constrained random test template" files. This will be a little slower for GitHub Sandbox tests right now, but still faster than it has been in the past. Closes [#972](https://github.com/SuffolkLITLab/ALKiln/issues/972).
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
|
|
58
|
+
- Improve report indentation and tweak styling.
|
|
59
|
+
- Clarify some logs, including addressing bite-sized issues like [#981](https://github.com/SuffolkLITLab/ALKiln/issues/981).
|
|
60
|
+
- The report now shows the name of every Step that gets run in a test.
|
|
61
|
+
|
|
62
|
+
### Internal
|
|
63
|
+
|
|
64
|
+
- Added: `lib/globals.js` file to hold some shared constant values across the framework. It should NOT manage state. We may want to change the name to `constants.js` or `global_contants.js`. Let's see how it serves us.
|
|
65
|
+
- Added: executable scripts for more setup steps - managing the artifacts path (at the start of a run) and validating and generating files.
|
|
66
|
+
- Changed: `Log` now prioritizes what folder it stores files in in this order:
|
|
67
|
+
1. Use the argument to use an existing folder and save that to runtime_config.json at root.
|
|
68
|
+
2. Use the argument to make a new folder with that name and save that to runtime_config.json at root.
|
|
69
|
+
3. Use the alread-existing folder name value in runtime_config.json at root
|
|
70
|
+
4. Create a new folder and save that to runtime_config.json at root
|
|
71
|
+
- Changed: Add `.error()` to `Log` for visual clarity when storing an error to throw later. We need to discuss this behavior and its return value. To make that work Logs can now get the `error` prop without throwing an error.
|
|
72
|
+
- Changed: the Story Table step now accepts multiple ids and stops at whatever id it reaches first. I highly recommend that only ALKiln generated tests use this feature. We may avoid documenting it unless authors ask for it.
|
|
73
|
+
- Changed: `.gitignore` and `.npmignore` more things
|
|
74
|
+
- Fixed: log codes checker obob.
|
|
75
|
+
- Fixed: updated `actions/upload-artifact@v3` to `actions/upload-artifact@v4`
|
|
76
|
+
|
|
77
|
+
## [5.14.0] - 2025-05-15
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- Adds a linear Step to properly set multi-line values for `textarea`s with a doc string (closes [#1003](https://github.com/SuffolkLITLab/ALKiln/issues/1003)). We are unable to fix the current "set variable" linear Step for this. See [this comment on #655](https://github.com/SuffolkLITLab/ALKiln/issues/655#issuecomment-2876491571).
|
|
82
|
+
|
|
83
|
+
### Internal
|
|
84
|
+
|
|
85
|
+
- Changes how Log joins logs.
|
|
86
|
+
- Allows reports to accept log messages as an argument without duplicating metadata text. Debug logs will still save duplicate messages.
|
|
87
|
+
|
|
48
88
|
## [5.13.4] - 2025-01-11
|
|
49
89
|
|
|
50
90
|
### Changed
|
package/action.yml
CHANGED
|
@@ -33,6 +33,10 @@ inputs:
|
|
|
33
33
|
description: "The version of docassemblecli to install."
|
|
34
34
|
required: false
|
|
35
35
|
default: "0.0.17"
|
|
36
|
+
ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO:
|
|
37
|
+
description: "The maximum number of tests ALKiln will generate for every Scenario that can generate tests."
|
|
38
|
+
required: false
|
|
39
|
+
# Default will be internal to avoid duplication of data
|
|
36
40
|
|
|
37
41
|
outputs:
|
|
38
42
|
PATH_TO_ARTIFACTS:
|
|
@@ -68,6 +72,7 @@ runs:
|
|
|
68
72
|
MAX_SECONDS_FOR_SETUP: ${{ inputs.MAX_SECONDS_FOR_SETUP }}
|
|
69
73
|
SERVER_RELOAD_TIMEOUT_SECONDS: ${{ inputs.SERVER_RELOAD_TIMEOUT_SECONDS }}
|
|
70
74
|
DOCASSEMBLECLI_VERSION: ${{ inputs.DOCASSEMBLECLI_VERSION }}
|
|
75
|
+
ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO: ${{ inputs.ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO }}
|
|
71
76
|
shell: bash
|
|
72
77
|
run: |
|
|
73
78
|
log="š” ALK0023 INFO: Set environment variables and create artifacts folder"
|
|
@@ -91,6 +96,7 @@ runs:
|
|
|
91
96
|
echo "DOCASSEMBLE_DEVELOPER_API_KEY=$DOCASSEMBLE_DEVELOPER_API_KEY" >> $GITHUB_ENV
|
|
92
97
|
echo "ALKILN_VERSION=$ALKILN_VERSION" >> $GITHUB_ENV
|
|
93
98
|
echo "MAX_SECONDS_FOR_SETUP=$MAX_SECONDS_FOR_SETUP" >> $GITHUB_ENV
|
|
99
|
+
echo "ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO=$ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO" >> $GITHUB_ENV
|
|
94
100
|
echo "SERVER_RELOAD_TIMEOUT_SECONDS=$SERVER_RELOAD_TIMEOUT_SECONDS" >> $GITHUB_ENV
|
|
95
101
|
echo "DOCASSEMBLECLI_VERSION=$DOCASSEMBLECLI_VERSION" >> $GITHUB_ENV
|
|
96
102
|
# Hard-coded internal ALKiln vars
|
|
@@ -100,10 +106,10 @@ runs:
|
|
|
100
106
|
run: |
|
|
101
107
|
log="š” ALK0024 INFO: Confirm environment variables"
|
|
102
108
|
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
103
|
-
vars_log=
|
|
109
|
+
vars_log='\nALKiln version is ${{ env.ALKILN_VERSION }}\nRepo is "${{ env.REPO_URL }}"\nBranch ref is "${{ env.BRANCH_PATH }}"\nCustom MAX_SECONDS_FOR_SETUP is "${{ env.MAX_SECONDS_FOR_SETUP }}"\nCustom SERVER_RELOAD_TIMEOUT_SECONDS is "${{ env.SERVER_RELOAD_TIMEOUT_SECONDS }}"\nCustom ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO is "${{ env.ALKILN_MAX_RANDOM_TESTS_PER_SCENARIO }}"\n'
|
|
104
110
|
echo -e "$vars_log" >> "${{ env.DEBUG_PATH }}" && echo -e "$vars_log"
|
|
105
111
|
|
|
106
|
-
# Install
|
|
112
|
+
# Install ALKiln during GitHub workflow
|
|
107
113
|
- name: "š” ALK0025 INFO: Set up node"
|
|
108
114
|
uses: actions/setup-node@v4
|
|
109
115
|
with:
|
|
@@ -115,8 +121,18 @@ runs:
|
|
|
115
121
|
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
116
122
|
npm install -g "@suffolklitlab/alkiln@$ALKILN_VERSION"
|
|
117
123
|
|
|
118
|
-
#
|
|
124
|
+
# Files prep
|
|
125
|
+
- shell: bash
|
|
126
|
+
env:
|
|
127
|
+
ARTIFACT_FOLDER: ${{ env.ARTIFACT_FOLDER }}
|
|
128
|
+
run: |
|
|
129
|
+
log="š” ALK0275 INFO: Prepare repository test files"
|
|
130
|
+
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
131
|
+
alkiln-artifacts --path="${{ env.ARTIFACT_FOLDER }}"
|
|
132
|
+
alkiln-validate
|
|
133
|
+
alkiln-generate
|
|
119
134
|
|
|
135
|
+
# Install package on playground
|
|
120
136
|
# Don't rely on the environment's version of python
|
|
121
137
|
- uses: actions/setup-python@v5
|
|
122
138
|
if: ${{ inputs.INSTALL_METHOD == 'playground' }}
|
|
@@ -129,7 +145,7 @@ runs:
|
|
|
129
145
|
log="š” ALK0027 INFO: Create a Project and install the package from GitHub"
|
|
130
146
|
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
131
147
|
pip install "docassemblecli==$DOCASSEMBLECLI_VERSION"
|
|
132
|
-
alkiln-setup
|
|
148
|
+
alkiln-setup
|
|
133
149
|
- name: "š¤ ALK0028 ERROR: Unable to create a Project"
|
|
134
150
|
if: ${{ inputs.INSTALL_METHOD == 'playground' && failure() }}
|
|
135
151
|
shell: bash
|
|
@@ -138,15 +154,15 @@ runs:
|
|
|
138
154
|
long_log="\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"
|
|
139
155
|
echo -e "$long_log" >> "${{ env.DEBUG_PATH }}" && echo -e "$long_log"
|
|
140
156
|
|
|
141
|
-
# Server
|
|
142
|
-
- name: "š” ALK0029 INFO:
|
|
157
|
+
# Server installation
|
|
158
|
+
- name: "š” ALK0029 INFO: Try to install the GitHub package onto the GitHub sandbox server"
|
|
143
159
|
if: ${{ inputs.INSTALL_METHOD == 'server' }}
|
|
144
160
|
shell: bash
|
|
145
161
|
run: |
|
|
146
162
|
log="š” ALK0029 INFO: Install the GitHub package onto the server"
|
|
147
163
|
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
148
|
-
alkiln-server-install
|
|
149
|
-
- name: "š¤ ALK0030 ERROR: Unable to install the package"
|
|
164
|
+
alkiln-server-install
|
|
165
|
+
- name: "š¤ ALK0030 ERROR: Unable to install the package on the GitHub sandbox server"
|
|
150
166
|
if: ${{ inputs.INSTALL_METHOD == 'server' && failure() }}
|
|
151
167
|
shell: bash
|
|
152
168
|
run: |
|
|
@@ -162,7 +178,7 @@ runs:
|
|
|
162
178
|
run: |
|
|
163
179
|
log="š” ALK0031 INFO: Run tests"
|
|
164
180
|
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
165
|
-
alkiln-run "$ALKILN_TAG_EXPRESSION"
|
|
181
|
+
alkiln-run "$ALKILN_TAG_EXPRESSION"
|
|
166
182
|
|
|
167
183
|
# on playground, delete project
|
|
168
184
|
- name: "š” ALK0032 INFO: Delete the Project from the Playground"
|
|
@@ -171,7 +187,7 @@ runs:
|
|
|
171
187
|
run: |
|
|
172
188
|
log="š” ALK0032 INFO: Delete the Project from the Playground"
|
|
173
189
|
echo -e "\n$log" >> "${{ env.DEBUG_PATH }}"
|
|
174
|
-
alkiln-takedown
|
|
190
|
+
alkiln-takedown
|
|
175
191
|
|
|
176
192
|
# Upload artifacts that subscribers can download on the Actions summary page
|
|
177
193
|
- name: "š” ALK0033 INFO: Upload artifacts folder"
|
|
@@ -51,15 +51,19 @@ runs:
|
|
|
51
51
|
run: |
|
|
52
52
|
log="š” ALK0018 INFO: Get path names with date and time"
|
|
53
53
|
timestamp="$(date +'%Y-%m-%d at %Hh%Mm%Ss' -u)"
|
|
54
|
+
# Where to get the contents for the artifact
|
|
54
55
|
debug_dir="/tmp"
|
|
55
|
-
|
|
56
|
+
debug_logs_path="$debug_dir/alkiln_docker_logs-${timestamp}UTC.txt"
|
|
57
|
+
# Where to put the artifact
|
|
56
58
|
artifact_folder="alkiln_github_server-${timestamp}UTC"
|
|
59
|
+
echo "debug_logs_path: $debug_logs_path"
|
|
60
|
+
echo "artifact_folder: $artifact_folder"
|
|
57
61
|
|
|
58
62
|
mkdir -p "$debug_dir"
|
|
59
63
|
mkdir -p "$artifact_folder"
|
|
60
|
-
echo -e "$log" >> "$
|
|
64
|
+
echo -e "$log" >> "$debug_logs_path"
|
|
61
65
|
|
|
62
|
-
echo "
|
|
66
|
+
echo "DEBUG_LOGS_PATH=$debug_logs_path" >> $GITHUB_ENV
|
|
63
67
|
echo "GITHUB_SERVER_ARTIFACT_NAME=$artifact_folder" >> $GITHUB_ENV
|
|
64
68
|
|
|
65
69
|
- shell: bash
|
|
@@ -68,7 +72,7 @@ runs:
|
|
|
68
72
|
DOCASSEMBLECLI_VERSION: ${{ inputs.DOCASSEMBLECLI_VERSION }}
|
|
69
73
|
run: |
|
|
70
74
|
log="š” ALK0001 INFO: Set environment variables"
|
|
71
|
-
echo -e "\n$log" >> "${{ env.
|
|
75
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
72
76
|
|
|
73
77
|
echo "MAX_SECONDS_FOR_DOCKER=$MAX_SECONDS_FOR_DOCKER" >> $GITHUB_ENV
|
|
74
78
|
echo "DOCASSEMBLECLI_VERSION=$DOCASSEMBLECLI_VERSION" >> $GITHUB_ENV
|
|
@@ -81,7 +85,7 @@ runs:
|
|
|
81
85
|
shell: bash
|
|
82
86
|
run: |
|
|
83
87
|
log="š” ALK0002 INFO: Create GitHub step output variables"
|
|
84
|
-
echo -e "\n$log" >> "${{ env.
|
|
88
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
85
89
|
echo "DOCASSEMBLE_DEVELOPER_API_KEY=$DA_ADMIN_API_KEY" >> "$GITHUB_OUTPUT"
|
|
86
90
|
echo "DA_ADMIN_EMAIL=$DA_ADMIN_EMAIL" >> "$GITHUB_OUTPUT"
|
|
87
91
|
echo "DA_ADMIN_PASSWORD=$DA_ADMIN_PASSWORD" >> "$GITHUB_OUTPUT"
|
|
@@ -92,19 +96,19 @@ runs:
|
|
|
92
96
|
shell: bash
|
|
93
97
|
run: |
|
|
94
98
|
log="š” ALK0003 INFO: Get config"
|
|
95
|
-
echo -e "\n$log" >> "${{ env.
|
|
99
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
96
100
|
|
|
97
101
|
mkdir /tmp/config
|
|
98
102
|
# Worth making this silent by defining a variable with > /dev/null...?
|
|
99
103
|
if [ -n "$CONFIG" ]
|
|
100
104
|
then
|
|
101
105
|
log2="š” ALK0004 INFO: The developer did provide a custom docassemble config file as an input into this action."
|
|
102
|
-
echo -e "\n$log2" >> "${{ env.
|
|
106
|
+
echo -e "\n$log2" >> "${{ env.DEBUG_LOGS_PATH }}" echo "$log2"
|
|
103
107
|
echo "$CONFIG" > /tmp/config/myconfig.yml
|
|
104
108
|
echo "CONFIG_ARGS=--env DA_CONFIG=/tmp/config/myconfig.yml --volume /tmp/config:/tmp/config " >> $GITHUB_ENV
|
|
105
109
|
else
|
|
106
110
|
log3="š” ALK0005 INFO: The developer did NOT provide a custom docassemble config file as an input into this action. Docassemble will use its default config."
|
|
107
|
-
echo -e "\n$log3" >> "${{ env.
|
|
111
|
+
echo -e "\n$log3" >> "${{ env.DEBUG_LOGS_PATH }}" echo "$log3"
|
|
108
112
|
echo "CONFIG_ARGS=" >> $GITHUB_ENV
|
|
109
113
|
fi
|
|
110
114
|
|
|
@@ -120,13 +124,13 @@ runs:
|
|
|
120
124
|
shell: bash
|
|
121
125
|
run: |
|
|
122
126
|
log="š” ALK0006 INFO: Determine docker logs visibility"
|
|
123
|
-
echo -e "\n$log" >> "${{ env.
|
|
127
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
124
128
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
125
129
|
echo "OUTPUT_DOCKER=$SHOW_DOCKER_OUTPUT" >> $GITHUB_ENV
|
|
126
|
-
echo -e "\n$SHOW_DOCKER_OUTPUT" >> "${{ env.
|
|
130
|
+
echo -e "\n$SHOW_DOCKER_OUTPUT" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
127
131
|
else
|
|
128
132
|
echo "OUTPUT_DOCKER=false" >> $GITHUB_ENV
|
|
129
|
-
echo -e "\nfalse" >> "${{ env.
|
|
133
|
+
echo -e "\nfalse" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
130
134
|
fi
|
|
131
135
|
|
|
132
136
|
# Messages about output
|
|
@@ -136,14 +140,14 @@ runs:
|
|
|
136
140
|
run: |
|
|
137
141
|
# š” ALK0007 INFO: ALKiln will now hide docker output
|
|
138
142
|
log="===\nš” ALK0007 INFO: ALKiln will now hide docker output to avoid possibly showing details about your config. If you want to get output to see more of what is going on, use \"with:\" and set the input \"SHOW_DOCKER_OUTPUT\" to \"true\". This output will only be visible to those who can already see the action output, like people with admin or write permissions.\n==="
|
|
139
|
-
echo -e "\n$log" >> "${{ env.
|
|
143
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log"
|
|
140
144
|
- name: "š” ALK0008 INFO: ALKiln will show docker output"
|
|
141
145
|
if: ${{ env.OUTPUT_DOCKER == 'true' }}
|
|
142
146
|
shell: bash
|
|
143
147
|
run: |
|
|
144
148
|
# š” ALK0008 INFO: ALKiln will show docker output
|
|
145
149
|
log="===\nš” ALK0008 INFO: ALKiln will show docker output. ALKiln cannot control this output. If you want to prevent output, use \"with:\" and set the input \"SHOW_DOCKER_OUTPUT\" to \"false\". This output will only be visible to those who can already see the action output, like people with admin or write permissions.\n==="
|
|
146
|
-
echo -e "\n$log" >> "${{ env.
|
|
150
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log"
|
|
147
151
|
|
|
148
152
|
# TODO: Reduce these to 1 block by putting ` > /dev/null 2>&1` into an env var
|
|
149
153
|
# No docker output
|
|
@@ -154,7 +158,7 @@ runs:
|
|
|
154
158
|
shell: bash
|
|
155
159
|
run: |
|
|
156
160
|
log="š” ALK0009 INFO: Download and start docker silently"
|
|
157
|
-
echo -e "\n$log" >> "${{ env.
|
|
161
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
158
162
|
docker pull jhpyle/docassemble > /dev/null 2>&1
|
|
159
163
|
docker run --name docassemble_container \
|
|
160
164
|
--env DA_ADMIN_EMAIL="$DA_ADMIN_EMAIL" \
|
|
@@ -171,7 +175,7 @@ runs:
|
|
|
171
175
|
shell: bash
|
|
172
176
|
run: |
|
|
173
177
|
log="š” ALK0010 INFO: Download and start docker"
|
|
174
|
-
echo -e "\n$log" >> "${{ env.
|
|
178
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
175
179
|
docker pull jhpyle/docassemble
|
|
176
180
|
docker run --name docassemble_container \
|
|
177
181
|
--env DA_ADMIN_EMAIL="$DA_ADMIN_EMAIL" \
|
|
@@ -189,13 +193,13 @@ runs:
|
|
|
189
193
|
run: |
|
|
190
194
|
# š” ALK0011 INFO: The following messages are not docker output
|
|
191
195
|
log="š” ALK0011 INFO: The following messages are NOT docker output, just ALKiln waiting for the server to start"
|
|
192
|
-
echo -e "\n$log" >> "${{ env.
|
|
196
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log"
|
|
193
197
|
|
|
194
198
|
- name: "š” ALK0012 INFO: Waiting for server to start"
|
|
195
199
|
shell: bash
|
|
196
200
|
run: |
|
|
197
201
|
log="š” ALK0012 INFO: Waiting for server to start"
|
|
198
|
-
echo -e "\n$log" >> "${{ env.
|
|
202
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
199
203
|
|
|
200
204
|
# Reset the SECONDS variable
|
|
201
205
|
SECONDS=0
|
|
@@ -205,27 +209,27 @@ runs:
|
|
|
205
209
|
response="start"
|
|
206
210
|
while [[ $response != *"200"* ]]; do
|
|
207
211
|
log2="š” ALK0013 INFO: Time elapsed: $SECONDS seconds"
|
|
208
|
-
echo -e "\n$log2" >> "${{ env.
|
|
212
|
+
echo -e "\n$log2" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log2"
|
|
209
213
|
|
|
210
214
|
# Check if max seconds till loading has passed
|
|
211
215
|
if [[ $SECONDS -ge $MAX_SECONDS_FOR_DOCKER ]]; then
|
|
212
216
|
log3="š¤ ALK0014 ERROR: Timed out waiting for docker container to serve the site. If you want to give your docker container more timem to install, set the MAX_SECONDS_FOR_DOCKER input for this action."
|
|
213
|
-
echo -e "\n$log3" >> "${{ env.
|
|
217
|
+
echo -e "\n$log3" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log3"
|
|
214
218
|
exit 1
|
|
215
219
|
fi
|
|
216
220
|
|
|
217
221
|
# Set the variable to a new string value in each iteration
|
|
218
222
|
response=$(curl -o /dev/null -s -w "%{http_code}\n" http://localhost:80/health_check?ready=1)
|
|
219
223
|
log4="š” ALK0015 INFO: Response is $response"
|
|
220
|
-
echo -e "\n$log4" >> "${{ env.
|
|
224
|
+
echo -e "\n$log4" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log4"
|
|
221
225
|
|
|
222
226
|
# Check if the string includes the desired text
|
|
223
227
|
if [[ $response == *"200"* ]]; then
|
|
224
228
|
log5="š” ALK0016 SUCCESS: Success! The docker container is ready!"
|
|
225
|
-
echo -e "\n$log5" >> "${{ env.
|
|
229
|
+
echo -e "\n$log5" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log5"
|
|
226
230
|
else
|
|
227
231
|
log6="š” ALK0017 INFO: The docker container is not ready yet. Will check again in 30 seconds."
|
|
228
|
-
echo -e "\n$log6" >> "${{ env.
|
|
232
|
+
echo -e "\n$log6" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log6"
|
|
229
233
|
sleep 30
|
|
230
234
|
fi
|
|
231
235
|
|
|
@@ -260,23 +264,23 @@ runs:
|
|
|
260
264
|
shell: bash
|
|
261
265
|
run: |
|
|
262
266
|
log="š” ALK0019 INFO: Create docker artifact data"
|
|
263
|
-
echo -e "\n$log" >> "${{ env.
|
|
264
|
-
echo "$(docker output docassemble_container)" >> "${{ env.
|
|
267
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
268
|
+
echo "$(docker output docassemble_container)" >> "${{ env.DEBUG_LOGS_PATH }}"
|
|
265
269
|
- name: "š” ALK0020 INFO: Upload artifacts folder"
|
|
266
270
|
if: ${{ always() && env.OUTPUT_DOCKER == 'true' }}
|
|
267
271
|
uses: actions/upload-artifact@v4
|
|
268
272
|
with:
|
|
269
273
|
name: ${{ env.GITHUB_SERVER_ARTIFACT_NAME }}
|
|
270
|
-
path: ${{ env.
|
|
274
|
+
path: ${{ env.DEBUG_LOGS_PATH }}
|
|
271
275
|
|
|
272
276
|
- shell: bash
|
|
273
277
|
if: ${{ success() }}
|
|
274
278
|
run: |
|
|
275
279
|
log="š” ALK0021 SUCCESS: ALKiln created the docker container and started the server!"
|
|
276
|
-
echo -e "\n$log" >> "${{ env.
|
|
280
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log"
|
|
277
281
|
|
|
278
282
|
- shell: bash
|
|
279
283
|
if: ${{ failure() }}
|
|
280
284
|
run: |
|
|
281
285
|
log="š¤ ALK0022 ERROR: Something went wrong. See above for more details."
|
|
282
|
-
echo -e "\n$log" >> "${{ env.
|
|
286
|
+
echo -e "\n$log" >> "${{ env.DEBUG_LOGS_PATH }}" && echo -e "$log"
|
package/docs/4_environments.md
CHANGED
|
@@ -223,7 +223,7 @@ This design is working within systems that limit how we can do what we need to d
|
|
|
223
223
|
|
|
224
224
|
Alternative: Get rid of our support for some of these environments. The temporary GitHub docassemble server environment hasn't been used by a lot of authors. Other than that, the other environments have gotten a lot of use. Even though authors have not yet used the temporary GitHub environment much, they say they want that functionality. The trouble there seems to be complexity with initial set up.
|
|
225
225
|
|
|
226
|
-
Alternative: Instead of dealing with separate runtimes, have one command and script that wraps all these currently separate processes in one runtime and handles which ones to trigger under what circumstances. If we included `./action_for_github/action.yml` in that command, we would prevent authors from customizing the temporary GitHub docassemble server. That would not be acceptable. To avoid closing off access to server customization, we can only partially integrate these different processes. Also, GitHub actions in general will still have to deal with some core business
|
|
226
|
+
Alternative: Instead of dealing with separate runtimes, have one command and script that wraps all these currently separate processes in one runtime and handles which ones to trigger under what circumstances. If we included `./action_for_github/action.yml` in that command, we would prevent authors from customizing the temporary GitHub docassemble server. That would not be acceptable. To avoid closing off access to server customization, we can only partially integrate these different processes. Also, GitHub actions in general will still sometimes have to deal with some core business. For example, they have to create the artifacts folder name so they can use it later to upload the artifacts. This combined runtime also feels more coupled/entangled and therefore harder to maintain. The need for more command line arguments could make local development more complicated. It is still worth considering.
|
|
227
227
|
|
|
228
228
|
<!-- Discuss: How to articulate the entanglement with more specifics and examples. -->
|
|
229
229
|
|
|
@@ -234,7 +234,7 @@ Alternative script names: `install_package`, `save_server`, `delete_package`.
|
|
|
234
234
|
_Security, privacy, observability, etc._
|
|
235
235
|
|
|
236
236
|
- Some tests need to use sensitive information. For example, some tests need a logged-in user and thus ALKiln needs the login info for a user. Different environments store this information differently and there is documentation about how to use sensitive information securely and privately.
|
|
237
|
-
- Core ALKiln code[^2] ends up needing to handle some of the complexity of the 4 environments. Example - the `Log` class `path` takes an optional initial argument to set the artifacts path
|
|
237
|
+
- Core ALKiln code[^2] ends up needing to handle some of the complexity of the 4 environments. Example - the `Log` class `path` takes an optional initial argument to set the artifacts path before the core code runs. The process in the core code (and elsewhere) have to assume that this path already exists and use config values. We have tried to abstract environment complexity out to `run_cucumber.js`, the script that wraps the core code, but there is still logic that the core code handles.
|
|
238
238
|
|
|
239
239
|
---
|
|
240
240
|
|