@suffolklitlab/alkiln 5.12.0-delete4 → 5.12.0-delete6
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 +14 -10
- package/.github/workflows/playground.yml +1 -1
- package/CHANGELOG.md +1 -0
- package/lib/docassemble/docassemble_api_interface.js +9 -11
- package/lib/scope.js +0 -2
- package/lib/steps.js +2 -2
- package/package.json +1 -1
- package/tests/log_codes/check_codes.sh +1 -1
|
@@ -75,12 +75,14 @@ jobs:
|
|
|
75
75
|
shell: bash
|
|
76
76
|
|
|
77
77
|
#### Developer note: You can probably leave this out
|
|
78
|
-
- name: "
|
|
78
|
+
- name: "Add a low-level user and their API key (in an env var)"
|
|
79
79
|
env:
|
|
80
80
|
SERVER_URL: "${{ steps.github_server.outputs.SERVER_URL }}"
|
|
81
81
|
KEY: ${{ steps.github_server.outputs.DOCASSEMBLE_DEVELOPER_API_KEY }}
|
|
82
82
|
run: |
|
|
83
83
|
# Create user and their API key
|
|
84
|
+
|
|
85
|
+
# Install json processor
|
|
84
86
|
sudo apt-get install jq
|
|
85
87
|
|
|
86
88
|
# https://docassemble.org/docs/api.html#user_new
|
|
@@ -98,7 +100,7 @@ jobs:
|
|
|
98
100
|
user_id=$(echo "$user_data" | jq '.user_id' -r)
|
|
99
101
|
|
|
100
102
|
# https://docassemble.org/docs/api.html#api_user_user_id_api_post
|
|
101
|
-
|
|
103
|
+
new_key_with_quotes=$(curl -X POST \
|
|
102
104
|
${{ env.SERVER_URL }}/api/user/"$user_id"/api \
|
|
103
105
|
-H 'Content-Type: application/json' \
|
|
104
106
|
-d '{
|
|
@@ -106,16 +108,18 @@ jobs:
|
|
|
106
108
|
"name": "alkiln_key",
|
|
107
109
|
"method": "none"
|
|
108
110
|
}')
|
|
109
|
-
echo "
|
|
110
|
-
|
|
111
|
+
echo "new key (watch out, this contains actual quotation marks): $new_key_with_quotes"
|
|
112
|
+
no_end_quote="${new_key_with_quotes%\"}"
|
|
113
|
+
unquoted="${no_end_quote#\"}"
|
|
114
|
+
echo "unquoted: $unquoted"
|
|
111
115
|
|
|
112
|
-
echo "USER_NO_PERMISSIONS_API_KEY=$
|
|
116
|
+
echo "USER_NO_PERMISSIONS_API_KEY=$unquoted" >> "$GITHUB_ENV"
|
|
113
117
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
#### Developer note: You can probably leave this out
|
|
119
|
+
## Optional debugging to explore things like docker issues
|
|
120
|
+
#- name: Docker debug tmate session
|
|
121
|
+
# #if: ${{ failure() && github.event.inputs.enable_tmate == 'true' }}
|
|
122
|
+
# uses: mxschmitt/action-tmate@v3
|
|
119
123
|
|
|
120
124
|
#### Developer note: You can probably leave this out
|
|
121
125
|
- name: "Create other env vars for our own tests from server output"
|
|
@@ -77,6 +77,6 @@ jobs:
|
|
|
77
77
|
# Internal: docassemble changes sometimes break @a11y tests. That is
|
|
78
78
|
# a da problem, not ours. We will trigger these tests manually when we
|
|
79
79
|
# want to check up on this.
|
|
80
|
-
ALKILN_TAG_EXPRESSION: "
|
|
80
|
+
ALKILN_TAG_EXPRESSION: "@del3"
|
|
81
81
|
#### Developer note: You can probably leave this out
|
|
82
82
|
ALKILN_VERSION: delete
|
package/CHANGELOG.md
CHANGED
|
@@ -58,6 +58,7 @@ Format:
|
|
|
58
58
|
- Test deleting interviews upon interview completion for signed in users.
|
|
59
59
|
- Switch to mostly using a lowest-access-level user account for actually running interviews.
|
|
60
60
|
- Added @temp_error to neutralize tests that are getting undesired errors right now, but which we anticipate being fixed soon. We want to ignore them for a short while. For example, an upstream change temporarily breaking some tests.
|
|
61
|
+
- Excluded docassemble/ALKiln files from log code checks.
|
|
61
62
|
|
|
62
63
|
## [5.12.0] - 2024-06-06
|
|
63
64
|
|
|
@@ -280,11 +280,10 @@ da_i.quietly_try_to_delete_interviews = async function ({ interviews = {}, api_k
|
|
|
280
280
|
});
|
|
281
281
|
responses.push( sub_responses );
|
|
282
282
|
} else {
|
|
283
|
-
log.
|
|
283
|
+
log.info({ type: `da api info`, code: `ALK0191`, pre: `There is no interview to delete.` });
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
return responses;
|
|
287
|
-
|
|
288
287
|
}; // Ends da_i.quietly_try_to_delete_interviews()
|
|
289
288
|
|
|
290
289
|
// node -e 'require("./lib/docassemble/docassemble_api_interface.js").quietly_delete_one_interview(...)'
|
|
@@ -296,7 +295,7 @@ da_i.quietly_delete_one_interview = async function ( timeout, { interview = {},
|
|
|
296
295
|
let responses = [];
|
|
297
296
|
for ( let api_key of api_keys ) {
|
|
298
297
|
try {
|
|
299
|
-
log.
|
|
298
|
+
log.info({ type: `da api info`, code: `ALK0188`,
|
|
300
299
|
pre: `Trying to delete the interview with the id ${ interview.uid } and an API key.`
|
|
301
300
|
});
|
|
302
301
|
|
|
@@ -307,13 +306,13 @@ da_i.quietly_delete_one_interview = async function ( timeout, { interview = {},
|
|
|
307
306
|
});
|
|
308
307
|
responses.push( response );
|
|
309
308
|
|
|
310
|
-
log.
|
|
309
|
+
log.info({ type: `da api info`, code: `ALK0189`,
|
|
311
310
|
pre: `No error when trying to delete interview ${ interview.uid } at ${ interview.i }.`
|
|
312
311
|
});
|
|
313
312
|
} catch ( error ) {
|
|
314
313
|
error.interview = interview;
|
|
315
314
|
let msg = `Error when deleting the interview. See https://docassemble.org/docs/api.html#session_delete.`
|
|
316
|
-
log.
|
|
315
|
+
log.info({ type: `da api info`, code: `ALK0190`, pre: msg, data: error });
|
|
317
316
|
}
|
|
318
317
|
} // ends for api keys
|
|
319
318
|
return responses;
|
|
@@ -348,7 +347,7 @@ da_i.get_interview = async function ({ interview = {}, api_keys = [], options =
|
|
|
348
347
|
if ( interview && interview.uid ) {
|
|
349
348
|
for ( let api_key of api_keys ) {
|
|
350
349
|
try {
|
|
351
|
-
log.
|
|
350
|
+
log.info({ type: `da api info`, code: `ALK0192`, pre: `Trying to get the interview with the id ${ interview.uid } and an API key.` });
|
|
352
351
|
|
|
353
352
|
// Actual work:
|
|
354
353
|
let response = await _da_REST.get_interview( timeout, {
|
|
@@ -357,22 +356,21 @@ da_i.get_interview = async function ({ interview = {}, api_keys = [], options =
|
|
|
357
356
|
});
|
|
358
357
|
|
|
359
358
|
if ( response && response.data && response.data.items && response.data.items[0] && response.data.items[0].session ) {
|
|
360
|
-
log.
|
|
359
|
+
log.info({ type: `da api info`, code: `ALK0193`, pre: `Status ${ response.status }. Got ${ response.data.items[0].session }.`});
|
|
361
360
|
return response.data.items[0];
|
|
362
361
|
} else {
|
|
363
|
-
log.
|
|
362
|
+
log.info({ type: `da api info`, code: `ALK0194`, pre: `Status ${ response.status }. Cannot find ${ interview.uid }`});
|
|
364
363
|
}
|
|
365
364
|
|
|
366
365
|
} catch ( error ) {
|
|
367
366
|
error.interview = interview;
|
|
368
367
|
let msg = `${ error.status || `No error.status.` } ${ error.statusText || error.data || `No error.statusText.` } Ran into an error when getting the interview ${ interview.uid }. See https://docassemble.org/docs/api.html#interviews.`
|
|
369
|
-
log.
|
|
368
|
+
log.info({ type: `da api info`, code: `ALK0195`, pre: msg, data: error });
|
|
370
369
|
}
|
|
371
370
|
} // ends for api_keys
|
|
372
371
|
} else {
|
|
373
|
-
log.
|
|
372
|
+
log.info({ type: `da api info`, code: `ALK0196`, pre: `There is no interview to get.` });
|
|
374
373
|
}
|
|
375
374
|
|
|
376
375
|
return null;
|
|
377
|
-
|
|
378
376
|
}; // Ends da_i.get_interview()
|
package/lib/scope.js
CHANGED
package/lib/steps.js
CHANGED
|
@@ -1481,7 +1481,7 @@ After(async function(scenario) {
|
|
|
1481
1481
|
// going to the wrong file). If it becomes a problem we can track it down later.
|
|
1482
1482
|
if ( visible_keys.length > 0 ) {
|
|
1483
1483
|
// Can an API key ever see an interview that it can't delete?
|
|
1484
|
-
log.
|
|
1484
|
+
log.info({ type: `internal warning`, code: `ALK0197`,
|
|
1485
1485
|
pre: `The API key can see ${ visible_keys.length } interviews that were not deleted: ${ visible_keys.join( ', ' ) }`
|
|
1486
1486
|
});
|
|
1487
1487
|
}
|
|
@@ -1493,7 +1493,7 @@ After(async function(scenario) {
|
|
|
1493
1493
|
// interview. If it becomes a problem we can track it down later.
|
|
1494
1494
|
// Consider add "internal" to docs: "If you see this, make an
|
|
1495
1495
|
// issue in ALKiln with your debug/verbose log"
|
|
1496
|
-
log.
|
|
1496
|
+
log.info({ type: `internal warning`, code: `ALK0198`, pre: `Error while cleaning up interviews.`, data: error });
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ fi
|
|
|
16
16
|
# The grepped files will include the list of all the codes that have been
|
|
17
17
|
# removed and are no longer used. Syntax used works with GitHub cli ([[:digit:]])
|
|
18
18
|
# https://stackoverflow.com/a/6901221
|
|
19
|
-
lines=$(grep -roh --exclude="tests/log_codes/check_codes.sh" --exclude="debug_log.txt" --exclude="cucumber-report.txt" --exclude-dir="
|
|
19
|
+
lines=$(grep -roh --exclude="tests/log_codes/check_codes.sh" --exclude="debug_log.txt" --exclude="cucumber-report.txt" --exclude-dir="ALKilnTests" --exclude-dir="node_modules" --exclude-dir='alkiln-*' --exclude-dir='_alkiln*' 'ALK[[:digit:]][[:digit:]][[:digit:]][[:digit:]]' "$directory")
|
|
20
20
|
sorted=$(echo "$lines" | sort -n)
|
|
21
21
|
|
|
22
22
|
|