Compare commits
5
Commits
7689433376
...
3cd159a63e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cd159a63e | ||
|
|
0688075542 | ||
|
|
7edf179ec9 | ||
|
|
c0aa7fa8f5 | ||
|
|
a77f72f5d6 |
@@ -27,7 +27,10 @@ jobs:
|
|||||||
- name: Run checks
|
- name: Run checks
|
||||||
env:
|
env:
|
||||||
API_BASE: ${{ github.server_url }}/api/v1
|
API_BASE: ${{ github.server_url }}/api/v1
|
||||||
|
# github.server_url is the internal runner host, so the commit link needs the public one.
|
||||||
|
WEB_BASE: https://git.ruv.wtf
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
|
SHA: ${{ github.sha }}
|
||||||
# Prefer a PAT with issue write scope (secret: GITEA_TOKEN).
|
# Prefer a PAT with issue write scope (secret: GITEA_TOKEN).
|
||||||
# Default GITHUB_TOKEN is usually scoped to this repo only.
|
# Default GITHUB_TOKEN is usually scoped to this repo only.
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ set -u
|
|||||||
API_BASE="${API_BASE:?API_BASE is required}"
|
API_BASE="${API_BASE:?API_BASE is required}"
|
||||||
REPO="${REPO:?REPO is required}"
|
REPO="${REPO:?REPO is required}"
|
||||||
TOKEN="${TOKEN:?TOKEN is required}"
|
TOKEN="${TOKEN:?TOKEN is required}"
|
||||||
|
SHA="${SHA:-}"
|
||||||
|
BASE="${WEB_BASE:-${API_BASE%/api/v1}}"
|
||||||
LABEL="ci-checks"
|
LABEL="ci-checks"
|
||||||
SHOW="${SHOW:-50}"
|
SHOW="${SHOW:-50}"
|
||||||
|
|
||||||
@@ -20,10 +22,11 @@ npx eslint src --format json > "$WORK/eslint.json" || true
|
|||||||
jq -r --arg root "$PWD" '.[] | .filePath as $f | .messages[] | select(.ruleId) | "eslint/" + .ruleId + "\t" + (($f | ltrimstr($root + "/")) + ":" + (.line | tostring))' "$WORK/eslint.json" >> "$FINDINGS"
|
jq -r --arg root "$PWD" '.[] | .filePath as $f | .messages[] | select(.ruleId) | "eslint/" + .ruleId + "\t" + (($f | ltrimstr($root + "/")) + ":" + (.line | tostring))' "$WORK/eslint.json" >> "$FINDINGS"
|
||||||
|
|
||||||
npx prettier --check . > "$WORK/prettier.log" 2>&1 || true
|
npx prettier --check . > "$WORK/prettier.log" 2>&1 || true
|
||||||
sed -nE 's/^\[warn\] (.*)$/prettier\t\1/p' "$WORK/prettier.log" >> "$FINDINGS"
|
# Prettier forces colour in CI, so strip the ANSI codes before matching.
|
||||||
|
sed -E 's/\x1b\[[0-9;]*m//g' "$WORK/prettier.log" | sed -nE 's/^\[warn\] (.*)$/prettier\t\1/p' >> "$FINDINGS"
|
||||||
|
|
||||||
npx tsc --noEmit > "$WORK/tsc.log" 2>&1 || true
|
npx tsc --noEmit > "$WORK/tsc.log" 2>&1 || true
|
||||||
sed -nE 's/^(.*)\(([0-9]+),([0-9]+)\): error (TS[0-9]+):.*/tsc\/\4\t\1(\2,\3)/p' "$WORK/tsc.log" >> "$FINDINGS"
|
sed -E 's/\x1b\[[0-9;]*m//g' "$WORK/tsc.log" | sed -nE 's/^(.*)\(([0-9]+),([0-9]+)\): error (TS[0-9]+):.*/tsc\/\4\t\1(\2,\3)/p' >> "$FINDINGS"
|
||||||
|
|
||||||
api() { # api METHOD PATH [JSON] -> response body on stdout, non-zero on HTTP failure
|
api() { # api METHOD PATH [JSON] -> response body on stdout, non-zero on HTTP failure
|
||||||
local method=$1 path=$2 data=${3-} code
|
local method=$1 path=$2 data=${3-} code
|
||||||
@@ -77,6 +80,9 @@ jq -r '[((.body // "") | capture("<!-- ci-check: (?<k>[^ ]+) -->").k), .number]
|
|||||||
|
|
||||||
while IFS=$'\t' read -r key number; do
|
while IFS=$'\t' read -r key number; do
|
||||||
if ! grep -qF -- "$key"$'\t' "$FINDINGS"; then
|
if ! grep -qF -- "$key"$'\t' "$FINDINGS"; then
|
||||||
|
if [ -n "$SHA" ]; then
|
||||||
|
api POST "/issues/$number/comments" "$(jq -n --arg b "Fixed in [$(printf '%s' "$SHA" | cut -c1-7)]($BASE/commit/$SHA)." '{body: $b}')" > /dev/null
|
||||||
|
fi
|
||||||
api PATCH "/issues/$number" '{"state": "closed"}' > /dev/null
|
api PATCH "/issues/$number" '{"state": "closed"}' > /dev/null
|
||||||
fi
|
fi
|
||||||
done < "$WORK/keys.tsv"
|
done < "$WORK/keys.tsv"
|
||||||
|
|||||||
@@ -453,9 +453,7 @@ function MessageNotifications() {
|
|||||||
function BackgroundSyncSetup() {
|
function BackgroundSyncSetup() {
|
||||||
const mx = useMatrixClient();
|
const mx = useMatrixClient();
|
||||||
// Try to make a simple fetch to verify component is rendering
|
// Try to make a simple fetch to verify component is rendering
|
||||||
try {
|
fetch('/_matrix/client/v3/sync', { method: 'HEAD' }).catch(() => {});
|
||||||
fetch('/_matrix/client/v3/sync', { method: 'HEAD' }).catch(() => {});
|
|
||||||
} catch {}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('BackgroundSyncSetup: Starting background sync for', mx.getUserId());
|
console.log('BackgroundSyncSetup: Starting background sync for', mx.getUserId());
|
||||||
@@ -554,7 +552,7 @@ function AndroidShareIntentHandler() {
|
|||||||
const originalFile = await materializeSharedFile(sharedFile, share.receivedAt);
|
const originalFile = await materializeSharedFile(sharedFile, share.receivedAt);
|
||||||
|
|
||||||
let fileToUpload = originalFile;
|
let fileToUpload = originalFile;
|
||||||
let encInfo: any = undefined;
|
let encInfo: any;
|
||||||
|
|
||||||
if (room.hasEncryptionStateEvent()) {
|
if (room.hasEncryptionStateEvent()) {
|
||||||
const encrypted = await encryptFile(originalFile);
|
const encrypted = await encryptFile(originalFile);
|
||||||
|
|||||||
Reference in New Issue
Block a user