From 8010325743fdd5d61f5389a72295dbe9a9f2f521 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 09:37:47 +0100 Subject: [PATCH 01/22] First, test in a branch --- .github/workflows/sigrid-scheduled.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/sigrid-scheduled.yml diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml new file mode 100644 index 00000000..b06cf2b2 --- /dev/null +++ b/.github/workflows/sigrid-scheduled.yml @@ -0,0 +1,24 @@ +name: Sigrid pull request feedback +on: [pull_request] + +jobs: + sigridci: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Sigrid CI + uses: Software-Improvement-Group/sigridci@main + with: + customer: sig + system: sigridci-client + env: + SIGRID_CI_TOKEN: "${{ secrets.SIGRID_CI_TOKEN }}" + - name: "Sigrid pull request feedback" + uses: mshick/add-pr-comment@v2 + if: always() + with: + message-id: sigrid + message-path: sigrid-ci-output/feedback.md \ No newline at end of file From 6c540ad56d708044f8ff1126a61b3bb4a6b44ab2 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 12:31:14 +0100 Subject: [PATCH 02/22] Change the name... --- .github/workflows/sigrid-scheduled.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index b06cf2b2..29a94d88 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -1,4 +1,4 @@ -name: Sigrid pull request feedback +name: Sigrid CI scheduled on: [pull_request] jobs: From 5ee8b9a52da82371dbf2c75252e7fb871d9e4b9d Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 13:19:34 +0100 Subject: [PATCH 03/22] Use action from branch --- .github/workflows/sigrid-scheduled.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index 29a94d88..b0a17703 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -10,7 +10,7 @@ jobs: with: fetch-depth: 0 - name: Sigrid CI - uses: Software-Improvement-Group/sigridci@main + uses: Software-Improvement-Group/sigridci@add_scheduled_job with: customer: sig system: sigridci-client From ffb547bbb8a1591e203135244e8f6fc6877c195a Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 13:26:00 +0100 Subject: [PATCH 04/22] Use existing image --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index a958667d..7f1e65ee 100644 --- a/action.yaml +++ b/action.yaml @@ -94,7 +94,7 @@ inputs: runs: using: "docker" - image: "Dockerfile" + image: "softwareimprovementgroup/sigridci:latest" args: - "--customer" - ${{ inputs.customer }} From 82e247573cffc070958a87fe2a0de72e34bae5a8 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 13:26:56 +0100 Subject: [PATCH 05/22] Need to add docker:// --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 7f1e65ee..6fd20adc 100644 --- a/action.yaml +++ b/action.yaml @@ -94,7 +94,7 @@ inputs: runs: using: "docker" - image: "softwareimprovementgroup/sigridci:latest" + image: "docker://softwareimprovementgroup/sigridci:latest" args: - "--customer" - ${{ inputs.customer }} From 19999383a2520e117eeb1938823cc78bcf76f5fd Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 13:31:49 +0100 Subject: [PATCH 06/22] Complete the command --- action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yaml b/action.yaml index 6fd20adc..5d6a8d37 100644 --- a/action.yaml +++ b/action.yaml @@ -96,6 +96,7 @@ runs: using: "docker" image: "docker://softwareimprovementgroup/sigridci:latest" args: + - "/sigridci/sigridci.py" - "--customer" - ${{ inputs.customer }} - "--system" From 6c47f90d6c489029ca0d7c8845630c78bb844c21 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 13:37:10 +0100 Subject: [PATCH 07/22] Change 'includehistory' default --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 5d6a8d37..3a9b6620 100644 --- a/action.yaml +++ b/action.yaml @@ -35,7 +35,7 @@ inputs: includehistory: description: "When enabled, includes the repository history in the upload (true/false). Required for architecture quality analysis." required: false - default: false + default: true showupload: description: "Outputs the list of files included in the upload to Sigrid, for troubleshooting (true/false)." required: false From 713cead1b6789d584e380564aedbdbd18bbe60d4 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 13:44:26 +0100 Subject: [PATCH 08/22] Are we who we think we are? --- action.yaml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/action.yaml b/action.yaml index 3a9b6620..5755da47 100644 --- a/action.yaml +++ b/action.yaml @@ -96,25 +96,8 @@ runs: using: "docker" image: "docker://softwareimprovementgroup/sigridci:latest" args: - - "/sigridci/sigridci.py" - - "--customer" - - ${{ inputs.customer }} - - "--system" - - ${{ inputs.system }} - - "--source" - - ${{ inputs.source }} - - "--targetquality" - - ${{ inputs.targetquality }} - - ${{ (inputs.publish == 'true' && '--publish') || '--dummy' }} - - ${{ (inputs.publishonly == 'true' && '--publishonly') || '--dummy' }} - - ${{ (inputs.includehistory == 'true' && '--include-history') || '--dummy' }} - - "--exclude" - - ${{ inputs.exclude }} - - ${{ (inputs.showupload == 'true' && '--showupload') || '--dummy' }} - - "--include" - - ${{ inputs.include }} - - "--subsystem" - - ${{ inputs.subsystem }} + - "whoami" + env: displayname: ${{ inputs.displayname }} divisionname: ${{ inputs.divisionname }} From b1d7455c522ad9b5c3a7680f369465e512589d3e Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 13:47:25 +0100 Subject: [PATCH 09/22] Right user, but where's my config? --- action.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 5755da47..91c7873f 100644 --- a/action.yaml +++ b/action.yaml @@ -96,7 +96,10 @@ runs: using: "docker" image: "docker://softwareimprovementgroup/sigridci:latest" args: - - "whoami" + - "git" + - "config" + - "--global" + - "--list" env: displayname: ${{ inputs.displayname }} From 970837cb2c1929218c22d1910d4c2e16342784d2 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 14:34:06 +0100 Subject: [PATCH 10/22] Add script to configure safe.directory --- Dockerfile | 3 ++- action.yaml | 25 +++++++++++++++++++------ entrypoint.sh | 4 ++++ 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 473611d0..3e02f804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ RUN apk --no-cache -U upgrade && \ apk --no-cache add git COPY sigridci /sigridci +COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN git config --global --add safe.directory '*' -ENTRYPOINT ["/sigridci/sigridci.py"] +ENTRYPOINT ["entrypoint.sh"] diff --git a/action.yaml b/action.yaml index 91c7873f..ff04dc8c 100644 --- a/action.yaml +++ b/action.yaml @@ -94,13 +94,26 @@ inputs: runs: using: "docker" - image: "docker://softwareimprovementgroup/sigridci:latest" + image: "Dockerfile" args: - - "git" - - "config" - - "--global" - - "--list" - + - "--customer" + - ${{ inputs.customer }} + - "--system" + - ${{ inputs.system }} + - "--source" + - ${{ inputs.source }} + - "--targetquality" + - ${{ inputs.targetquality }} + - ${{ (inputs.publish == 'true' && '--publish') || '--dummy' }} + - ${{ (inputs.publishonly == 'true' && '--publishonly') || '--dummy' }} + - ${{ (inputs.includehistory == 'true' && '--include-history') || '--dummy' }} + - "--exclude" + - ${{ inputs.exclude }} + - ${{ (inputs.showupload == 'true' && '--showupload') || '--dummy' }} + - "--include" + - ${{ inputs.include }} + - "--subsystem" + - ${{ inputs.subsystem }} env: displayname: ${{ inputs.displayname }} divisionname: ${{ inputs.divisionname }} diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..1b70f158 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +git config --global --add safe.directory '*' +/sigridci/sigridci.py $@ \ No newline at end of file From bdf3a31f1f33d64190358415f6e1d4719d85d428 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 14:36:26 +0100 Subject: [PATCH 11/22] Use full path --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3e02f804..c8105cd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ COPY sigridci /sigridci COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN git config --global --add safe.directory '*' -ENTRYPOINT ["entrypoint.sh"] +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] From 6c765ef203cee5cc125854711176d84f80099a33 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 14:38:23 +0100 Subject: [PATCH 12/22] Make executable --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 index 1b70f158..970b7cc7 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/sh git config --global --add safe.directory '*' -/sigridci/sigridci.py $@ \ No newline at end of file +/sigridci/sigridci.py $@ From e1275bbf55605f9ca204562eebb2febb4a8d3e86 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 14:40:13 +0100 Subject: [PATCH 13/22] Make sure git log works --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 970b7cc7..53014df3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/sh git config --global --add safe.directory '*' -/sigridci/sigridci.py $@ +git log | tail -10 +/sigridci/sigridci.py "$@" From fd5f22c4a5c35efc98c337a21272651ca92399be Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 15:01:27 +0100 Subject: [PATCH 14/22] See if the 'system' scope works --- Dockerfile | 2 +- entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c8105cd0..29b3b0f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ RUN apk --no-cache -U upgrade && \ COPY sigridci /sigridci COPY entrypoint.sh /usr/local/bin/entrypoint.sh -RUN git config --global --add safe.directory '*' +RUN git config --system --add safe.directory '*' ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 53014df3..0c7738f8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -git config --global --add safe.directory '*' +#git config --global --add safe.directory '*' git log | tail -10 /sigridci/sigridci.py "$@" From 64fed6132b1a8c8b05a40b319caef0442417de55 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Thu, 12 Dec 2024 15:03:08 +0100 Subject: [PATCH 15/22] Let's try that then --- Dockerfile | 3 +-- entrypoint.sh | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 29b3b0f9..58dda0f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ RUN apk --no-cache -U upgrade && \ apk --no-cache add git COPY sigridci /sigridci -COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN git config --system --add safe.directory '*' -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +ENTRYPOINT ["/sigridci/sigridci.py"] diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 0c7738f8..00000000 --- a/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -#git config --global --add safe.directory '*' -git log | tail -10 -/sigridci/sigridci.py "$@" From 5e6d5f77a03cb2e95acb0888f40fbdd383ca1218 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Fri, 13 Dec 2024 14:40:21 +0100 Subject: [PATCH 16/22] See if main works now --- .github/workflows/sigrid-scheduled.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index b0a17703..29a94d88 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -10,7 +10,7 @@ jobs: with: fetch-depth: 0 - name: Sigrid CI - uses: Software-Improvement-Group/sigridci@add_scheduled_job + uses: Software-Improvement-Group/sigridci@main with: customer: sig system: sigridci-client From 2cfcc8c07b7bd26b98977e03bdb0d88f1691c699 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Fri, 13 Dec 2024 14:44:30 +0100 Subject: [PATCH 17/22] Try image for timing --- .github/workflows/sigrid-scheduled.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index 29a94d88..9a26f4ac 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -10,7 +10,7 @@ jobs: with: fetch-depth: 0 - name: Sigrid CI - uses: Software-Improvement-Group/sigridci@main + uses: "docker://softwareimprovementgroup/sigrid-ci:latest" with: customer: sig system: sigridci-client From f5a75dc5934ad598c89d399a6e0412894671e3b8 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Fri, 13 Dec 2024 14:45:30 +0100 Subject: [PATCH 18/22] Typo --- .github/workflows/sigrid-scheduled.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index 9a26f4ac..53a6fcae 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -10,7 +10,7 @@ jobs: with: fetch-depth: 0 - name: Sigrid CI - uses: "docker://softwareimprovementgroup/sigrid-ci:latest" + uses: "docker://softwareimprovementgroup/sigridci:latest" with: customer: sig system: sigridci-client From 09d126d06c5b204d1b347b55c036171b9bd7a623 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Fri, 13 Dec 2024 17:17:42 +0100 Subject: [PATCH 19/22] Use image from hub --- .github/workflows/sigrid-scheduled.yml | 2 +- action.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index 53a6fcae..b0a17703 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -10,7 +10,7 @@ jobs: with: fetch-depth: 0 - name: Sigrid CI - uses: "docker://softwareimprovementgroup/sigridci:latest" + uses: Software-Improvement-Group/sigridci@add_scheduled_job with: customer: sig system: sigridci-client diff --git a/action.yaml b/action.yaml index ff04dc8c..33f2c7a3 100644 --- a/action.yaml +++ b/action.yaml @@ -94,8 +94,9 @@ inputs: runs: using: "docker" - image: "Dockerfile" + image: "docker://software-improvement-group/sigridci:latest" args: + - "/sigridci/sigridci.py" - "--customer" - ${{ inputs.customer }} - "--system" From 4f624bdd6d14e4bc5269096aa1baa434801c7c18 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Fri, 13 Dec 2024 17:19:27 +0100 Subject: [PATCH 20/22] CoPilot got it wrong --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 33f2c7a3..3a9b6620 100644 --- a/action.yaml +++ b/action.yaml @@ -94,7 +94,7 @@ inputs: runs: using: "docker" - image: "docker://software-improvement-group/sigridci:latest" + image: "docker://softwareimprovementgroup/sigridci:latest" args: - "/sigridci/sigridci.py" - "--customer" From 0a74382ac4f6c8773bd93ed8e01cbb69b7abec18 Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Fri, 13 Dec 2024 17:29:02 +0100 Subject: [PATCH 21/22] Just go with existing action --- .github/workflows/sigrid-scheduled.yml | 2 +- action.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index b0a17703..29a94d88 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -10,7 +10,7 @@ jobs: with: fetch-depth: 0 - name: Sigrid CI - uses: Software-Improvement-Group/sigridci@add_scheduled_job + uses: Software-Improvement-Group/sigridci@main with: customer: sig system: sigridci-client diff --git a/action.yaml b/action.yaml index 3a9b6620..a958667d 100644 --- a/action.yaml +++ b/action.yaml @@ -35,7 +35,7 @@ inputs: includehistory: description: "When enabled, includes the repository history in the upload (true/false). Required for architecture quality analysis." required: false - default: true + default: false showupload: description: "Outputs the list of files included in the upload to Sigrid, for troubleshooting (true/false)." required: false @@ -94,9 +94,8 @@ inputs: runs: using: "docker" - image: "docker://softwareimprovementgroup/sigridci:latest" + image: "Dockerfile" args: - - "/sigridci/sigridci.py" - "--customer" - ${{ inputs.customer }} - "--system" From 8d637abc59f91e4645d732adc28a24bcb600c84d Mon Sep 17 00:00:00 2001 From: Marijn Dessens Date: Tue, 28 Jan 2025 13:19:32 +0100 Subject: [PATCH 22/22] Add cron schedule --- .github/workflows/sigrid-scheduled.yml | 11 ++++------- sigrid.yaml | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sigrid-scheduled.yml b/.github/workflows/sigrid-scheduled.yml index 29a94d88..06d115fa 100644 --- a/.github/workflows/sigrid-scheduled.yml +++ b/.github/workflows/sigrid-scheduled.yml @@ -1,5 +1,7 @@ name: Sigrid CI scheduled -on: [pull_request] +on: + schedule: + - cron: '0 1 * * *' jobs: sigridci: @@ -14,11 +16,6 @@ jobs: with: customer: sig system: sigridci-client + publishonly: true env: SIGRID_CI_TOKEN: "${{ secrets.SIGRID_CI_TOKEN }}" - - name: "Sigrid pull request feedback" - uses: mshick/add-pr-comment@v2 - if: always() - with: - message-id: sigrid - message-path: sigrid-ci-output/feedback.md \ No newline at end of file diff --git a/sigrid.yaml b/sigrid.yaml index 51f587a2..a02280e0 100644 --- a/sigrid.yaml +++ b/sigrid.yaml @@ -1,3 +1,4 @@ +default_excludes: false languages: - name: "Python" thirdpartyfindings: