Skip to content

Conversation

Teebor-Choka
Copy link
Contributor

This pull request introduces a new pre-commit workflow to streamline checks before merging and integrates it into the existing checks.yaml workflow. The changes focus on defining the pre-commit workflow and ensuring it is properly linked and configured.

New Pre-commit Workflow:

  • .github/workflows/checks-pre-commit.yaml: Added a new pre-commit workflow that runs on merge_group events and uses self-hosted runners. It includes steps for hardening the runner, checking out the repository, installing Nix, setting up Cachix, and running pre-commit checks.

Integration with Existing Workflow:

  • .github/workflows/checks.yaml: Integrated the pre-commit workflow into the main checks.yaml file by adding a new pre-commit job that uses the newly created checks-pre-commit.yaml workflow. It passes the source repository and branch as inputs and inherits secrets.

@Teebor-Choka Teebor-Choka added this to the 3.0.0 milestone Jul 1, 2025
@Teebor-Choka Teebor-Choka requested review from ausias-armesto and a team July 1, 2025 12:21
@Teebor-Choka Teebor-Choka self-assigned this Jul 1, 2025
@Teebor-Choka Teebor-Choka marked this pull request as ready for review July 1, 2025 12:21
@Copilot Copilot AI review requested due to automatic review settings July 1, 2025 12:21
Copy link
Contributor

coderabbitai bot commented Jul 1, 2025

📝 Walkthrough

Walkthrough

A new reusable GitHub Actions workflow for pre-commit checks is introduced, and the main workflow is updated to use it as a job. The new workflow enforces concurrency, secures the runner, sets up Nix and Cachix, and runs pre-commit checks in a reproducible environment.

Changes

File(s) Change Summary
.github/workflows/checks-pre-commit.yaml Added a new reusable workflow for pre-commit checks with runner hardening, Nix, Cachix, and pre-commit execution.
.github/workflows/checks.yaml Added a pre-commit job that calls the new reusable workflow with dynamic repository and branch inputs.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant checks.yaml
    participant checks-pre-commit.yaml
    participant Self-hosted Runner

    GitHub Actions->>checks.yaml: Trigger workflow (PR or merge group)
    checks.yaml->>checks-pre-commit.yaml: Call reusable pre-commit workflow\n(pass repo/branch)
    checks-pre-commit.yaml->>Self-hosted Runner: Start job (pre-commit)
    Self-hosted Runner->>Self-hosted Runner: Harden environment
    Self-hosted Runner->>Self-hosted Runner: Checkout repo/branch
    Self-hosted Runner->>Self-hosted Runner: Install Nix & configure Cachix
    Self-hosted Runner->>Self-hosted Runner: Run pre-commit checks
Loading

Suggested labels

devops

Suggested reviewers

  • NumberFour8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a dedicated pre-commit CI workflow and integrates it into the existing checks pipeline to enforce pre-commit checks before merging.

  • Introduces .github/workflows/checks-pre-commit.yaml with runner hardening, Nix/Cachix setup, and a pre-commit step.
  • Updates .github/workflows/checks.yaml to call the new pre-commit workflow as a job.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/checks-pre-commit.yaml New workflow triggered on merge_group to run hardened pre-commit checks using Nix/Cachix.
.github/workflows/checks.yaml Added pre-commit job via workflow_call to include the new workflow in main CI checks.
Comments suppressed due to low confidence (2)

.github/workflows/checks-pre-commit.yaml:16

  • The concurrency group suffix '-audit' appears to be copied from the audit workflow; consider renaming it to '-pre-commit' to avoid conflicts and clarify its purpose.
  group: ${{ inputs.source_branch || github.ref_name }}-audit

.github/workflows/checks-pre-commit.yaml:20

  • The job ID 'cargo-audit' doesn't match this workflow's function; renaming it to 'pre-commit' or 'pre-commit-checks' would improve clarity.
  cargo-audit:

@Teebor-Choka Teebor-Choka enabled auto-merge (squash) July 1, 2025 12:22
@github-actions github-actions bot added the toolchain Developer and product happiness label Jul 1, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
.github/workflows/checks-pre-commit.yaml (1)

22-22: Unknown self-hosted runner label will keep actionlint red
Add the label to .github/actionlint.yaml’s runner-labels allow-list (or disable the rule) so CI lint stays green.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73b9e58 and 545a139.

📒 Files selected for processing (2)
  • .github/workflows/checks-pre-commit.yaml (1 hunks)
  • .github/workflows/checks.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:34-43
Timestamp: 2025-06-30T08:33:20.974Z
Learning: In the hoprnet repository, the maintainer ausias-armesto prefers to add commit types to the semantic PR validation workflow incrementally as needed, rather than preemptively adding all possible types. This conservative approach keeps the workflow configuration lean.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: mjadach-iv
PR: hoprnet/hoprnet#6663
File: deploy/compose/.env.sample:57-57
Timestamp: 2024-11-21T13:58:22.345Z
Learning: In code reviews for this project, focus comments on the changes made in the PR, and avoid discussing unrelated code.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:83-95
Timestamp: 2025-06-30T08:36:01.702Z
Learning: The self-hosted-hoprnet-small runners in the hoprnet repository have GitHub CLI (gh) pre-installed and available for use in workflows.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:0-0
Timestamp: 2024-11-26T17:47:21.777Z
Learning: In `.github/workflows/build-binaries.yaml`, when writing shell scripts in GitHub Actions workflows, the user prefers to set environment variables individually rather than grouping them together.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-07-28T07:26:06.634Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
.github/workflows/checks.yaml (7)
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:34-43
Timestamp: 2025-06-30T08:33:20.974Z
Learning: In the hoprnet repository, the maintainer ausias-armesto prefers to add commit types to the semantic PR validation workflow incrementally as needed, rather than preemptively adding all possible types. This conservative approach keeps the workflow configuration lean.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
.github/workflows/checks-pre-commit.yaml (11)
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:34-43
Timestamp: 2025-06-30T08:33:20.974Z
Learning: In the hoprnet repository, the maintainer ausias-armesto prefers to add commit types to the semantic PR validation workflow incrementally as needed, rather than preemptively adding all possible types. This conservative approach keeps the workflow configuration lean.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:83-95
Timestamp: 2025-06-30T08:36:01.702Z
Learning: The self-hosted-hoprnet-small runners in the hoprnet repository have GitHub CLI (gh) pre-installed and available for use in workflows.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6972
File: .github/workflows/audit-pr.yaml:25-32
Timestamp: 2025-04-02T11:36:56.281Z
Learning: For HOPR projects, auditing tools like cargo-audit should be managed through the Nix environment rather than installed separately to ensure consistency and reproducibility.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Create a Git pre-commit hook to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:29:02.123Z
Learning: Create a Git pre-commit hook to prevent changes to the `contracts-addresses.json` file.
🪛 actionlint (1.7.7)
.github/workflows/checks-pre-commit.yaml

22-22: label "self-hosted-hoprnet-small" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: PR / Add labels
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust
  • GitHub Check: Zizmor / Zizmor
  • GitHub Check: Lint / Lint
  • GitHub Check: Audit / Audit
  • GitHub Check: Build Candidate Binaries (hoprd)
  • GitHub Check: tests-unit
  • GitHub Check: Build Candidate Binaries (hopli)
  • GitHub Check: tests-unit-nightly
🔇 Additional comments (1)
.github/workflows/checks.yaml (1)

27-33: Downstream jobs still run in parallel – add needs if you want gating
Right now audit, lint, etc. start immediately; if the intent is “fail fast on pre-commit”, wire them through needs: pre-commit (or adjust matrix).

Example:

  audit:
+    needs: pre-commit

Replicate for lint and zizmor.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/workflows/checks-pre-commit.yaml (1)

30-36: Checkout will fail when the workflow is triggered directly via merge_group

On merge_group events no workflow_call inputs are provided, so
${{ inputs.source_repo }} and inputs.source_branch expand to empty strings.
actions/checkout treats an empty repository as an error and the job aborts before any pre-commit hook is executed.

-          repository: ${{ inputs.source_repo }}
-          ref: ${{ inputs.source_branch }}
+          repository: ${{ inputs.source_repo   || github.repository }}
+          ref:        ${{ inputs.source_branch || github.ref }}

This preserves the current behaviour when the workflow is invoked via checks.yaml but makes stand-alone merge_group runs work as well.

🧹 Nitpick comments (1)
.github/workflows/checks-pre-commit.yaml (1)

24-29: Remember to flip the egress policy to block once the audit period is over

The TODO is still present. Keeping the runner in audit mode indefinitely defeats the purpose of step-security/harden-runner. Set a calendar reminder or create a follow-up issue so this doesn’t slip through the cracks.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 545a139 and a496686.

📒 Files selected for processing (1)
  • .github/workflows/checks-pre-commit.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.683Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:34-43
Timestamp: 2025-06-30T08:33:20.974Z
Learning: In the hoprnet repository, the maintainer ausias-armesto prefers to add commit types to the semantic PR validation workflow incrementally as needed, rather than preemptively adding all possible types. This conservative approach keeps the workflow configuration lean.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: mjadach-iv
PR: hoprnet/hoprnet#6663
File: deploy/compose/.env.sample:57-57
Timestamp: 2024-11-21T13:58:22.345Z
Learning: In code reviews for this project, focus comments on the changes made in the PR, and avoid discussing unrelated code.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:83-95
Timestamp: 2025-06-30T08:36:01.702Z
Learning: The self-hosted-hoprnet-small runners in the hoprnet repository have GitHub CLI (gh) pre-installed and available for use in workflows.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-07-28T07:26:06.634Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6204
File: chain/api/src/config.rs:263-270
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Teebor-Choka indicated that the configuration object for chain configs will be refactored in a future update.
.github/workflows/checks-pre-commit.yaml (21)
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.683Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:34-43
Timestamp: 2025-06-30T08:33:20.974Z
Learning: In the hoprnet repository, the maintainer ausias-armesto prefers to add commit types to the semantic PR validation workflow incrementally as needed, rather than preemptively adding all possible types. This conservative approach keeps the workflow configuration lean.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:39:11.293Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The user has asked to add a Git pre-commit hook to the PR to prevent changes to the `contracts-addresses.json` file.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:83-95
Timestamp: 2025-06-30T08:36:01.702Z
Learning: The self-hosted-hoprnet-small runners in the hoprnet repository have GitHub CLI (gh) pre-installed and available for use in workflows.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-10-09T06:16:18.170Z
Learning: Create a Git pre-commit hook to prevent changes to the `contracts-addresses.json` file.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
Learnt from: mjadach-iv
PR: hoprnet/hoprnet#6663
File: deploy/compose/.env.sample:57-57
Timestamp: 2024-11-21T13:58:22.345Z
Learning: In code reviews for this project, focus comments on the changes made in the PR, and avoid discussing unrelated code.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/build-dappnode.yaml:40-40
Timestamp: 2025-05-27T16:23:08.868Z
Learning: In the hoprnet repository's GitHub workflows, labels are passed from build.yaml to build-dappnode.yaml with a trailing comma using `format('{0},', join(github.event.pull_request.labels.*.name, ','))`. Therefore, the condition checks in build-dappnode.yaml correctly use `format('package:{0},', inputs.dappnode_repository)` with a trailing comma to match the exact label format and prevent false positives.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6545
File: transport/p2p/src/swarm.rs:491-494
Timestamp: 2024-10-11T10:43:34.869Z
Learning: When reviewing revert pull requests in the `hoprnet/hoprnet` repository, avoid making code recommendations or suggestions.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#7231
File: flake.nix:599-608
Timestamp: 2025-06-11T13:34:45.385Z
Learning: The repository intentionally relies on Commitizen’s default configuration; absence of a `.cz.*` file or `[tool.commitizen]` section is expected and should not be flagged in future reviews.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6366
File: ethereum/contracts/contracts-addresses.json:0-0
Timestamp: 2024-07-11T10:29:02.123Z
Learning: Create a Git pre-commit hook to prevent changes to the `contracts-addresses.json` file.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6379
File: .github/scripts/immutable-files-check.sh:1-1
Timestamp: 2024-07-11T12:39:43.940Z
Learning: The `git diff --name-only HEAD` command is used to check for changes between the working directory and the last commit, which is appropriate for preventing committed changes.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6379
File: .github/scripts/immutable-files-check.sh:1-1
Timestamp: 2024-10-09T06:16:23.638Z
Learning: The `git diff --name-only HEAD` command is used to check for changes between the working directory and the last commit, which is appropriate for preventing committed changes.
🪛 actionlint (1.7.7)
.github/workflows/checks-pre-commit.yaml

22-22: label "self-hosted-hoprnet-small" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Zizmor / Zizmor
  • GitHub Check: Audit / Audit
  • GitHub Check: Lint / Lint
  • GitHub Check: hoprd / docker
  • GitHub Check: hopli / docker
  • GitHub Check: Docs / Rust
  • GitHub Check: Build Candidate Binaries (hoprd)
  • GitHub Check: Build Candidate Binaries (hopli)
  • GitHub Check: tests-unit
  • GitHub Check: tests-unit-nightly
🔇 Additional comments (1)
.github/workflows/checks-pre-commit.yaml (1)

49-50: 👍 Correct CI-style invocation of pre-commit

Running pre-commit run --all-files --show-diff-on-failure guarantees non-interactive execution and fails the job on hook errors.

@Teebor-Choka Teebor-Choka merged commit 9070827 into master Jul 1, 2025
31 of 32 checks passed
@Teebor-Choka Teebor-Choka deleted the kauki/ci/enforce-pre-commit-checks branch July 1, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain Developer and product happiness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants