From c0a0ccc13138073abb30262123f6c17482616414 Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Wed, 21 Oct 2026 10:14:57 +0800 Subject: [PATCH 1/7] Throwaway: sample with Danish and Malay comments, and a caller of english-comments Refs #204 --- .gitea/workflows/verify-english-comments.yml | 16 ++++++++++++++++ trial/sample.py | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .gitea/workflows/verify-english-comments.yml create mode 100644 trial/sample.py diff --git a/.gitea/workflows/verify-english-comments.yml b/.gitea/workflows/verify-english-comments.yml new file mode 100644 index 0000000..8979278 --- /dev/null +++ b/.gitea/workflows/verify-english-comments.yml @@ -0,0 +1,16 @@ +name: Verify English comments + +# Throwaway (MIL-013 task 8, #204): calls the reusable workflow at main on a +# pull request. Delete with the branch. +on: + pull_request: + +jobs: + english-comments: + permissions: + contents: read + issues: write + pull-requests: write + uses: TirSystem/github-action/.gitea/workflows/english-comments.yml@main + with: + tools-ref: main diff --git a/trial/sample.py b/trial/sample.py new file mode 100644 index 0000000..682626c --- /dev/null +++ b/trial/sample.py @@ -0,0 +1,14 @@ +"""Throwaway sample for the English-comments trial (MIL-013 task 8).""" + + +def total(basket): + # This function adds the totals of the basket together and returns the sum + # Denne funktion beregner totalen for kurven og gemmer resultatet i en midlertidig mappe + result = sum(basket) + + # Fungsi ini mengira jumlah bagi troli dan menyimpan hasil dalam folder sementara + return result + + +def quote(): + return "tak" # Tak for hjælpen, sagde kunden og beregner totalen for kurven # english-comments: ignore -- 2.54.0 From 33fd243204c254464d5ea6e07501418efe6331cb Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Wed, 21 Oct 2026 10:22:03 +0800 Subject: [PATCH 2/7] Throwaway: print the contexts of a called workflow Refs #204 --- .gitea/workflows/debug-contexts.yml | 31 ++++++++++++++++++++ .gitea/workflows/verify-english-comments.yml | 5 ++++ 2 files changed, 36 insertions(+) create mode 100644 .gitea/workflows/debug-contexts.yml diff --git a/.gitea/workflows/debug-contexts.yml b/.gitea/workflows/debug-contexts.yml new file mode 100644 index 0000000..a117c54 --- /dev/null +++ b/.gitea/workflows/debug-contexts.yml @@ -0,0 +1,31 @@ +name: Debug contexts + +# Throwaway (MIL-013 task 8): which of these conditions hold in a called workflow? +on: + workflow_call: + +jobs: + debug: + runs-on: ubuntu-latest + steps: + - name: Print the contexts + run: echo "event_name=${{ gitea.event_name }} number=${{ gitea.event.pull_request.number }} author=${{ gitea.event.pull_request.user.login }} base_ref=${{ gitea.base_ref }} api=${{ gitea.api_url }} server=${{ gitea.server_url }} run_number=${{ gitea.run_number }}" + - name: Failing step + id: failing + continue-on-error: true + run: exit 1 + - name: A always() + if: ${{ always() }} + run: echo "ran A always" + - name: B event is pull_request + if: ${{ gitea.event_name == 'pull_request' }} + run: echo "ran B pull_request" + - name: C always and event + if: ${{ always() && gitea.event_name == 'pull_request' }} + run: echo "ran C always and pull_request" + - name: D event via github context + if: ${{ github.event_name == 'pull_request' }} + run: echo "ran D github.event_name" + - name: E no braces + if: always() && gitea.event_name == 'pull_request' + run: echo "ran E no braces" diff --git a/.gitea/workflows/verify-english-comments.yml b/.gitea/workflows/verify-english-comments.yml index 8979278..84eed26 100644 --- a/.gitea/workflows/verify-english-comments.yml +++ b/.gitea/workflows/verify-english-comments.yml @@ -14,3 +14,8 @@ jobs: uses: TirSystem/github-action/.gitea/workflows/english-comments.yml@main with: tools-ref: main + + debug: + permissions: + contents: read + uses: ./.gitea/workflows/debug-contexts.yml -- 2.54.0 From e9bb6b6bf9ae0cddbadb1b5d48e776eab56d516e Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Wed, 21 Oct 2026 10:24:16 +0800 Subject: [PATCH 3/7] Throwaway: try other conditions for a pull request Refs #204 --- .gitea/workflows/debug-contexts.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/debug-contexts.yml b/.gitea/workflows/debug-contexts.yml index a117c54..7835db1 100644 --- a/.gitea/workflows/debug-contexts.yml +++ b/.gitea/workflows/debug-contexts.yml @@ -17,15 +17,15 @@ jobs: - name: A always() if: ${{ always() }} run: echo "ran A always" - - name: B event is pull_request - if: ${{ gitea.event_name == 'pull_request' }} - run: echo "ran B pull_request" - - name: C always and event - if: ${{ always() && gitea.event_name == 'pull_request' }} - run: echo "ran C always and pull_request" - - name: D event via github context - if: ${{ github.event_name == 'pull_request' }} - run: echo "ran D github.event_name" - - name: E no braces - if: always() && gitea.event_name == 'pull_request' - run: echo "ran E no braces" + - name: F number not empty + if: ${{ always() && gitea.event.pull_request.number != '' }} + run: echo "ran F number not empty" + - name: G number truthy + if: ${{ always() && gitea.event.pull_request.number }} + run: echo "ran G number truthy" + - name: H pull_request object + if: ${{ always() && gitea.event.pull_request }} + run: echo "ran H pull_request object" + - name: I base_ref not empty + if: ${{ always() && gitea.base_ref != '' }} + run: echo "ran I base_ref not empty" -- 2.54.0 From 93def5746bd62e11b9db642388351fa28314bd34 Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Wed, 21 Oct 2026 10:26:28 +0800 Subject: [PATCH 4/7] Throwaway: call the fix branch of english-comments Refs #204 --- .gitea/workflows/debug-contexts.yml | 31 -------------------- .gitea/workflows/verify-english-comments.yml | 13 +++----- 2 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 .gitea/workflows/debug-contexts.yml diff --git a/.gitea/workflows/debug-contexts.yml b/.gitea/workflows/debug-contexts.yml deleted file mode 100644 index 7835db1..0000000 --- a/.gitea/workflows/debug-contexts.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Debug contexts - -# Throwaway (MIL-013 task 8): which of these conditions hold in a called workflow? -on: - workflow_call: - -jobs: - debug: - runs-on: ubuntu-latest - steps: - - name: Print the contexts - run: echo "event_name=${{ gitea.event_name }} number=${{ gitea.event.pull_request.number }} author=${{ gitea.event.pull_request.user.login }} base_ref=${{ gitea.base_ref }} api=${{ gitea.api_url }} server=${{ gitea.server_url }} run_number=${{ gitea.run_number }}" - - name: Failing step - id: failing - continue-on-error: true - run: exit 1 - - name: A always() - if: ${{ always() }} - run: echo "ran A always" - - name: F number not empty - if: ${{ always() && gitea.event.pull_request.number != '' }} - run: echo "ran F number not empty" - - name: G number truthy - if: ${{ always() && gitea.event.pull_request.number }} - run: echo "ran G number truthy" - - name: H pull_request object - if: ${{ always() && gitea.event.pull_request }} - run: echo "ran H pull_request object" - - name: I base_ref not empty - if: ${{ always() && gitea.base_ref != '' }} - run: echo "ran I base_ref not empty" diff --git a/.gitea/workflows/verify-english-comments.yml b/.gitea/workflows/verify-english-comments.yml index 84eed26..afa68b3 100644 --- a/.gitea/workflows/verify-english-comments.yml +++ b/.gitea/workflows/verify-english-comments.yml @@ -1,7 +1,7 @@ name: Verify English comments -# Throwaway (MIL-013 task 8, #204): calls the reusable workflow at main on a -# pull request. Delete with the branch. +# Throwaway (MIL-013 task 8, #204): calls the reusable workflow of the fix branch +# on a pull request. Delete with the branch. on: pull_request: @@ -11,11 +11,6 @@ jobs: contents: read issues: write pull-requests: write - uses: TirSystem/github-action/.gitea/workflows/english-comments.yml@main + uses: TirSystem/github-action/.gitea/workflows/english-comments.yml@mil-013-judge-each-line with: - tools-ref: main - - debug: - permissions: - contents: read - uses: ./.gitea/workflows/debug-contexts.yml + tools-ref: mil-013-judge-each-line -- 2.54.0 From 03b8ef5c068d307b5581f405bfc5992300688e4f Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Wed, 21 Oct 2026 10:29:27 +0800 Subject: [PATCH 5/7] Throwaway: another Danish comment, to see the comment updated Refs #204 --- trial/sample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trial/sample.py b/trial/sample.py index 682626c..5c12542 100644 --- a/trial/sample.py +++ b/trial/sample.py @@ -3,7 +3,7 @@ def total(basket): # This function adds the totals of the basket together and returns the sum - # Denne funktion beregner totalen for kurven og gemmer resultatet i en midlertidig mappe + # Denne funktion lægger tallene i kurven sammen og gemmer summen i en midlertidig mappe result = sum(basket) # Fungsi ini mengira jumlah bagi troli dan menyimpan hasil dalam folder sementara -- 2.54.0 From ccffc5b68f0040fa1357ccbfcc2911dbba2bc503 Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Wed, 21 Oct 2026 10:32:22 +0800 Subject: [PATCH 6/7] Throwaway: both comments rewritten in English Refs #204 --- trial/sample.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trial/sample.py b/trial/sample.py index 5c12542..9b52a15 100644 --- a/trial/sample.py +++ b/trial/sample.py @@ -3,10 +3,10 @@ def total(basket): # This function adds the totals of the basket together and returns the sum - # Denne funktion lægger tallene i kurven sammen og gemmer summen i en midlertidig mappe + # This function adds the numbers in the basket together and keeps the sum result = sum(basket) - # Fungsi ini mengira jumlah bagi troli dan menyimpan hasil dalam folder sementara + # The result is returned to the caller unchanged return result -- 2.54.0 From ac65e9c7fb016ce764dbde554db9e8d154096d32 Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Wed, 21 Oct 2026 10:34:12 +0800 Subject: [PATCH 7/7] Throwaway: a Malay comment again, to see the link of the run Refs #204 --- trial/sample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trial/sample.py b/trial/sample.py index 9b52a15..5ab3459 100644 --- a/trial/sample.py +++ b/trial/sample.py @@ -6,7 +6,7 @@ def total(basket): # This function adds the numbers in the basket together and keeps the sum result = sum(basket) - # The result is returned to the caller unchanged + # Fungsi ini mengira jumlah bagi troli dan menyimpan hasil dalam folder sementara return result -- 2.54.0