Skip to content

Add Netsukefile build workflow#43

Merged
leynos merged 3 commits intomainfrom
codex/add-github-workflow-for-netsuke-build-and-test
Aug 4, 2025
Merged

Add Netsukefile build workflow#43
leynos merged 3 commits intomainfrom
codex/add-github-workflow-for-netsuke-build-and-test

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Aug 4, 2025

Summary

  • add GitHub workflow to build Netsuke, run a simple Netsukefile and verify its artefact
  • provide shell script helper for asserting artefact existence
  • tick roadmap item for static Netsukefile execution

Testing

  • make fmt
  • make lint
  • make test
  • make markdownlint
  • make nixie (fails: error: too many arguments. Expected 0 arguments but got 1.)

https://chatgpt.com/codex/tasks/task_e_68913798ff6483229afa20b94a09d7b1

Summary by Sourcery

Set up a CI workflow to build and run a simple Netsukefile with Netsuke, validate its output via a helper script, and update documentation to reflect the completed roadmap milestone

CI:

  • Add GitHub Actions workflow to build a sample Netsukefile and verify its artifact

Documentation:

  • Mark static Netsukefile execution as completed in the roadmap and note CI validation

Tests:

  • Add shell script to assert the existence of build artifacts

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Aug 4, 2025

Reviewer's Guide

Adds CI support for static Netsukefile execution by introducing a GitHub Actions workflow to build and verify a sample Netsukefile, updating the roadmap documentation to reflect CI validation, and providing a shell script helper to assert artifact existence.

Flow diagram for assert-file-exists.sh helper script

flowchart TD
  Start([Start])
  Input[Get file path argument]
  Check{Does file exist?}
  Error[Print error and exit 1]
  Success[Exit 0]

  Start --> Input --> Check
  Check -- No --> Error
  Check -- Yes --> Success
Loading

File-Level Changes

Change Details Files
Roadmap updated to mark static Netsukefile execution as validated via CI
  • Ticked the checkbox for static Netsukefile execution
  • Added note on artefact validation through CI workflow
docs/roadmap.md
Add GitHub Actions workflow to build and test a sample Netsukefile
  • Defined pull_request and push triggers on main branch
  • Checked out code, set up Rust, and ran make build
  • Generated an inline Netsukefile manifest
  • Executed the Netsuke build for a sample target
  • Invoked the helper script to assert artifact creation
.github/workflows/netsukefile-test.yml
Provide a shell helper script for asserting build artifact existence
  • Created a Bash script with strict error handling (set -euo pipefail)
  • Accepted filename argument and exited with error if file is missing
scripts/assert-file-exists.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 4, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a continuous integration workflow to automate build and validation processes.
    • Added a script to verify the existence of generated files after builds.
  • Documentation

    • Updated the project roadmap to reflect completed milestones and clarified validation via CI workflow.

Walkthrough

Introduce a new GitHub Actions workflow to test Netsukefile builds on pull requests and main branch pushes. Add a Bash script to assert the existence of a generated file. Update the project roadmap to mark a success criterion as completed, with minor wording adjustments and a note on CI validation.

Changes

Cohort / File(s) Change Summary
CI Workflow Addition
.github/workflows/netsukefile-test.yml
Add a GitHub Actions workflow to automate building with Netsukefile and check for the existence of a generated file.
Assertion Script
scripts/assert-file-exists.sh
Introduce a Bash script that asserts the existence of a specified file, failing fast if the file is missing.
Roadmap Documentation
docs/roadmap.md
Mark a Phase 1 success criterion as completed, adjust spelling to "artefacts", and add a note on CI validation.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Runner (Ubuntu)
    participant Repo
    participant Bash Script

    GitHub Actions->>Runner (Ubuntu): Trigger workflow on PR or push to main
    Runner (Ubuntu)->>Repo: Checkout code
    Runner (Ubuntu)->>Runner (Ubuntu): Set up Rust
    Runner (Ubuntu)->>Runner (Ubuntu): Run make build
    Runner (Ubuntu)->>Runner (Ubuntu): Create Netsukefile manifest
    Runner (Ubuntu)->>Runner (Ubuntu): Run netsuke build to generate target
    Runner (Ubuntu)->>Bash Script: Run assert-file-exists.sh generated.txt
    Bash Script-->>Runner (Ubuntu): Exit 0 if file exists, error if not
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

In CI’s gentle, tireless hand,
Netsukefile builds on demand.
A script now checks if files appear—
No artefact? The red lights cheer!
The roadmap ticks with British pride,
As automated tests now safely guide.
🛠️✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d83990d and c50192e.

📒 Files selected for processing (2)
  • .github/workflows/netsukefile-test.yml (1 hunks)
  • scripts/assert-file-exists.sh (1 hunks)
🔇 Additional comments (3)
scripts/assert-file-exists.sh (2)

6-9: Argument validation implemented – good work
The upfront [[ $# -ne 1 ]] guard eliminates the unbound‐variable edge case and documents usage.


1-4: Remove review suggestion: script already executable
git ls-files -s scripts/assert-file-exists.sh outputs 100755, confirming the script has the executable bit set. No changes required.

.github/workflows/netsukefile-test.yml (1)

30-43: Verify build/profile mismatch

make build typically produces a release binary at target/release/netsuke, yet the workflow later runs ./target/debug/netsuke. Confirm the Makefile indeed builds the debug profile or adjust the command to match the produced artefact.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/add-github-workflow-for-netsuke-build-and-test

🪧 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.
  • 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.

Support

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

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 generate unit tests to generate unit tests for 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes and found some issues that need to be addressed.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d40363b and 977cfcb.

📒 Files selected for processing (3)
  • .github/workflows/netsukefile-test.yml (1 hunks)
  • docs/roadmap.md (1 hunks)
  • scripts/assert-file-exists.sh (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

docs/**/*.md: Use the markdown files within the docs/ directory as a knowledge base and source of truth for project requirements, dependency choices, and architectural decisions.
Proactively update the relevant file(s) in the docs/ directory to reflect the latest state when new decisions are made, requirements change, libraries are added/removed, or architectural patterns evolve.

Files:

  • docs/roadmap.md
**/*.md

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.md: Documentation must use en-GB-oxendict spelling and grammar, except for the naming of the "LICENSE" file.
Validate Markdown files using make markdownlint.
Run make fmt after any documentation changes to format all Markdown files and fix table markup.
Validate Mermaid diagrams in Markdown files by running make nixie.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks in Markdown must be wrapped at 120 columns.
Tables and headings in Markdown must not be wrapped.
Use dashes (-) for list bullets in Markdown.
Use GitHub-flavoured Markdown footnotes ([^1]) for references and footnotes.

Files:

  • docs/roadmap.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/roadmap.md
🧠 Learnings (1)
📚 Learning: netsuke can successfully take a netsukefile without any jinja syntax, compile it to a build.ninja fi...
Learnt from: CR
PR: leynos/netsuke#0
File: docs/roadmap.md:0-0
Timestamp: 2025-08-03T23:02:56.706Z
Learning: Netsuke can successfully take a Netsukefile without any Jinja syntax, compile it to a build.ninja file, and execute it via the ninja subprocess to produce the correct build artifacts.

Applied to files:

  • docs/roadmap.md
🔇 Additional comments (1)
docs/roadmap.md (1)

69-71: Run doc formatters after changing long bullets

make fmt re-wraps Markdown to 80-column width and keeps table alignment intact. Execute it and commit the resulting changes to avoid markdownlint noise in CI.

Comment thread .github/workflows/netsukefile-test.yml Outdated
Comment thread .github/workflows/netsukefile-test.yml
Comment thread .github/workflows/netsukefile-test.yml Outdated
Comment thread scripts/assert-file-exists.sh
Copy link
Copy Markdown
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: 1

♻️ Duplicate comments (3)
.github/workflows/netsukefile-test.yml (3)

15-15: Pin actions/checkout to a commit SHA
Still using the moving tag v4. Lock to an immutable SHA to mitigate supply-chain risk.


16-19: Add Cargo cache step to cut CI minutes
Persist the Cargo registry and target to slash rebuild time on subsequent runs.


22-29: Strip leading indentation from the heredoc
The current cat <<'MANIFEST' writes two-space indents into Netsukefile, polluting root-level YAML. Switch to <<-MANIFEST and use tab indents, or out-dent to column 0.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 977cfcb and d83990d.

📒 Files selected for processing (1)
  • .github/workflows/netsukefile-test.yml (1 hunks)

Comment thread .github/workflows/netsukefile-test.yml Outdated
@leynos leynos merged commit 3aa225b into main Aug 4, 2025
2 of 4 checks passed
@leynos leynos deleted the codex/add-github-workflow-for-netsuke-build-and-test branch August 4, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant