Skip to content

migrating to new workflows/makefiles - #191

Open
jleni wants to merge 5 commits into
mainfrom
feat/new-structure
Open

migrating to new workflows/makefiles#191
jleni wants to merge 5 commits into
mainfrom
feat/new-structure

Conversation

@jleni

@jleni jleni commented Mar 25, 2025

Copy link
Copy Markdown
Member

🔗 zboto Link

Comment thread .github/workflows/ci-go.yml Outdated
go-checks:
uses: zondax/_workflows/.github/workflows/_checks-golang.yaml@main
with:
package_path: packages/prio-api

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong value here

@lucaslopezf

Copy link
Copy Markdown
Contributor

Just saw this PR @jleni . Should we rebase and merge it?

Comment thread .github/workflows/ci-go.yml Fixed
@jleni
jleni force-pushed the feat/new-structure branch from 58c9d4b to 89e5c93 Compare August 29, 2026 07:18
The reusable golang workflow calls go-build/go-mod-check/go-lint/go-test.
Point those names at the existing targets and run CI on Go 1.25.
Comment on lines +17 to +20
uses: zondax/_workflows/.github/workflows/_checks-golang.yaml@main
with:
package_path: .
go_version: "1.25"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 7 days ago

To fix this, add an explicit permissions block in .github/workflows/ci-go.yml so the workflow does not rely on repository/org defaults. The least-privilege baseline for a CI workflow is typically contents: read. Since this workflow only triggers checks and calls a reusable workflow, setting workflow-level read-only permissions is the safest non-functional change unless specific write scopes are known to be required.

Best single fix here: insert a root-level permissions section after concurrency (before jobs) with:

  • contents: read

This keeps behavior functionally equivalent for normal read-only CI operations while satisfying CodeQL and documenting token scope.

Suggested changeset 1
.github/workflows/ci-go.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml
--- a/.github/workflows/ci-go.yml
+++ b/.github/workflows/ci-go.yml
@@ -12,6 +12,9 @@
   group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
   cancel-in-progress: true
 
+permissions:
+  contents: read
+
 jobs:
   go-checks:
     uses: zondax/_workflows/.github/workflows/_checks-golang.yaml@main
EOF
@@ -12,6 +12,9 @@
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
go-checks:
uses: zondax/_workflows/.github/workflows/_checks-golang.yaml@main
Copilot is powered by AI and may make mistakes. Always verify output.
golangci-lint's install.sh finds the expected hash with `grep <tarball>`
over the checksums file. Since v2.12.0 that file also lists
`<tarball>.sbom.json`, so the grep returns two hashes, compares both
against the one real hash, and always fails. Go lint checks have been
broken on every branch since the v2.12.0 release.

Download and unpack the release artifact directly instead, matching the
checksum line by exact filename. The version is pinned and overridable
via GOLANGCI_LINT_VERSION.

Keeping the prebuilt binary matters: golangci-lint v2.13.2 requires
Go 1.26 to build, while CI runs Go 1.25 with GOTOOLCHAIN=local, so
`go install` is not an option here.
With go-lint running again, three occurrences of the "development"
literal were flagged where the EnvironmentDevelopment constant already
exists in the same package. Use the constant.

Also wrap the deferred zap.ReplaceGlobals in TestInitLogger so
staticcheck SA9010 no longer flags the discarded restore function.
Behaviour is unchanged: the original logger is still restored on return.
Restoring the lint gate surfaced 53 pre-existing issues, all of them in
test files and examples rather than shipped code.

goconst fires on the short literals that table-driven tests and worked
examples repeat by design, and the gosec web-hardening rules target
request handlers in production, not the stub handlers tests stand up.
Exclude both paths so the gate reports on code that ships.

Production code is clean under the full linter set.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

❌ Test Coverage Report

Metric Value
Current Coverage 46.5%
Required Threshold 75%
Status FAILED

💡 How to improve coverage:

  • Add more unit tests to increase coverage
  • Focus on untested critical paths
  • Consider adjusting threshold if current coverage is acceptable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants