Skip to content

feat: add additional fields that are passed on to mkShell to support … - #18

Merged
trevex merged 1 commit into
mainfrom
feat/add-mkshell-env
Jun 10, 2026
Merged

trevex merged 1 commit into
mainfrom
feat/add-mkshell-env

Conversation

@trevex

@trevex trevex commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

…env among others

What

Additional fields that are inherited by mkShell.

Why

Required for UI prototype of solar.

Testing

Notes for reviewers

Checklist

  • Tests added/updated
  • No breaking changes (or upgrade path documented above)
  • Readable commit history (squashed and cleaned up as desired)
  • AI code review considered and comments resolved

Summary by CodeRabbit

  • Chores
    • Enhanced development environment configuration to support additional customization options, including custom names, input dependencies, and environment variables in the shell setup.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea3c60d6-82b8-45cc-93bf-7190f8cf49cb

📥 Commits

Reviewing files that changed from the base of the PR and between 9fe7728 and c40663e.

📒 Files selected for processing (1)
  • flake.nix

📝 Walkthrough

Walkthrough

The self.lib.mkShell helper function in flake.nix is enhanced to accept three new optional parameters—name, inputsFrom, and env—with appropriate defaults, and forwards them to the underlying pkgs.mkShell derivation via inherit.

Changes

mkShell Parameter Enhancement

Layer / File(s) Summary
mkShell signature and parameter forwarding
flake.nix
self.lib.mkShell function signature adds three parameters: name (defaults to "dev-shell"), inputsFrom (defaults to []), and env (defaults to {}). These parameters are forwarded to pkgs.mkShell via inherit name env inputsFrom.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A Nix shell grows with grace,
Three parameters find their place,
Name, inputs, and env too,
Dev environments—now more true! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is partially related to the changeset—it mentions adding additional fields to mkShell but is incomplete (ends with 'to support …'), making it unclear what specific purpose these fields serve. Complete the title to clearly specify what the new fields support, e.g., 'feat: add name, inputsFrom, and env parameters to mkShell'
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description covers all required template sections (What, Why, Testing, Notes, Checklist) but lacks specific testing details and no issue reference is included.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-mkshell-env

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@trevex
trevex merged commit 5107b50 into main Jun 10, 2026
7 checks passed
@trevex
trevex deleted the feat/add-mkshell-env branch June 10, 2026 12:40
@dermorz dermorz mentioned this pull request Sep 25, 2026
3 of 4 tasks
dermorz added a commit that referenced this pull request Oct 6, 2026
## What
Make the governance workflows reusable, so consumer repos call them from
a small stub instead of carrying copies that drift.
Closes #38. `scorecard` stays a standalone workflow per repo (decided in
#37).

## Why
Each consumer carries its own copy of `update-action-pins`,
`conventional-commits`, `osv-scanner` and the issue automations. The
copies have drifted — `update-action-pins` alone exists in three
variants, and dev-kit's own misses `- uses:` spacing and is gated by a
`paths` filter, which leaves a required check pending forever on PRs
outside those paths.

## Testing
- New `scripts/test-update-action-pins.sh` runs the real check extracted
from the workflow (via `yq`) against 12 cases: quoted refs, sequence
spacing, composite actions, reusable workflows, short SHAs. All pass;
the old matcher fails 2 of them. Wired into `test-actions.yml`.
- `actionlint` clean on all workflows and on the five README stubs (with
a dummy SHA).
- `renovate-dev-kit-lock`: the relock step ran on a Solar checkout with
the flake input bumped to v2.2.0 (`nix flake lock` relocks only
`dev-kit`; a second run commits nothing, so no loop), and the
`createCommitOnBranch` payload round-trips `flake.lock`. **Not run end
to end**: it needs the org's dev-kit GitHub App (Monday).
- Not yet called from another repo — the Solar pilot
(opendefensecloud/solution-arsenal#825) is the first real run.

## Notes for reviewers
- **One stub per workflow**, not grouped by trigger: a workflow has a
single `on:` block and `osv-scanner` runs on PR, push and a schedule, so
shared stubs would need `if:` guards and a union of permissions. A
single `org-checks.yml` was wanted to get one Renovate PR per dev-kit
release instead of one per stub; opendefensecloud/renovate-config#20's
`dev-kit` group now delivers that whatever the stub count.
- dev-kit runs the workflows on its own events from the same files
(`workflow_call` next to the regular triggers). `osv-scanner.yml` is
reusable only; dev-kit didn't scan itself before either.
- Pins bumped to what consumers already use (semantic-PR v6, checkout
v7, add-to-project v2), so switching to the stub doesn't downgrade them.
- **Breaking:** `make repo-settings` no longer installs
`update-action-pins.yml` — it would recreate the copy the stub replaces.
Upgrade path: the stubs in the README's "Governance workflows" section.
- **Check names change** to `<stub job> / <called job>`, e.g.
`update-action-pins / Check action pins`, `osv-scanner / scan-pr /
osv-scan`. Consumers must update `REPO_STATUS_CHECKS` and rerun `make
repo-settings` in the same change.
- Overlaps with #33 in `test-actions.yml` and `common.mk`; whichever
merges second may need a small rebase.

- **New: `renovate-dev-kit-lock.yml`.** Renovate's grouped dev-kit PR
(opendefensecloud/renovate-config#17/#18) bumps the flake input tag but
can't update `flake.lock`, so `nix develop` rewrites it in CI and
`diff-check` fails. This workflow commits `nix flake lock` to
`renovate/dev-kit` via a GitHub App token and `createCommitOnBranch`:
signed by GitHub (`required_signatures`), and it starts CI, which a
`GITHUB_TOKEN` push wouldn't. Needs, before merge:
- an org GitHub App (Contents: write, Pull requests: read) — done:
`dev-kit-bot`, installed on dev-kit and solution-arsenal for now;
extended to the other consumers once it proves itself in the pilot
- org secrets `DEV_KIT_BOT_APP_CLIENT_ID` and
`DEV_KIT_BOT_APP_PRIVATE_KEY` — done, shared with the same two repos
- the app's bot email in renovate-config's `gitIgnoredAuthors` — in
renovate-config#20

## Merge order
This PR is one step in a sequence; the relock workflow and
renovate-config#20's manual `flake.lock` note only look contradictory
without it:
1. **opendefensecloud/renovate-config#20** — dev-kit group, weekly lock
refresh; the dev-kit PR asks a human for the `flake.lock` commit
(interim).
2. ~~#34~~ (merged; this PR is rebased onto it and formatted with its
treefmt setup), then **this PR** and **#39** → release **v3.0.0**. The
relock workflow ships here, but no consumer calls it yet.
3. **Org GitHub App** (done: `dev-kit-bot`; its bot is in
`gitIgnoredAuthors` via renovate-config#20).
**opendefensecloud/renovate-config#19** then drops the manual steps.
4. **Rollout** (pilot opendefensecloud/solution-arsenal#825): a consumer
adds the relock stub only after renovate-config#20 is merged; before
that, the bot commit would make Renovate stop rebasing the branch.

## Not covered here
- dev-kit's own pins: no `renovate.json` yet, and dev-kit doesn't call
`renovate-auto-approve` itself — that's #40.
- dev-kit doesn't scan itself: `osv-scanner.yml` is reusable-only, and
dev-kit had no scan before either. No issue yet.

## Checklist
- [x] Tests added/updated
- [x] No breaking changes (or upgrade path documented above)
- [x] Readable commit history (squashed and cleaned up as desired)
- [ ] AI code review considered and comments resolved


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Automation**
* Governance, commit-check, issue-labeling, project-assignment, and
security-scanning workflows can be reused across repositories.
* Security scans run on pushes, pull requests, and scheduled events;
merge-queue events are no longer included.
* Action pin checks cover additional workflow and action reference
formats, with automated tests for supported cases.
* Renovate pull requests can automatically update the development kit
lockfile when needed.
* **Documentation**
* Added guidance on reusable workflows, permissions, triggers,
requirements, and required status checks.
  * Updated the documented status check for action pin validation.
* **Configuration**
  * Repository setup no longer installs the action pin update workflow.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

2 participants