Conversation
|
|
|
||
| let identity = env::var("MISE_NOTIFICATION_SIGN_IDENTITY").unwrap_or_else(|_| "-".into()); | ||
| let release_signed = identity != "-"; | ||
| let signing_enabled = env::var("MISE_NOTIFICATION_SIGNING").as_deref() != Ok("disabled"); |
There was a problem hiding this comment.
No macOS CI job sets MISE_NOTIFICATION_SIGNING=disabled, so the new build-script branch and the corresponding unsigned implementations in macos.rs are never compiled or tested. This is non-blocking, but a later change could restore the codesign dependency or break unsigned resource handling without CI catching it. Please add a macOS build or test invocation with this environment variable set.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe macOS notification helper now selects Disabled, AdHoc, or Release signing. Build metadata, signature resources, bundle fingerprints, completion checks, installation, and verification follow the selected mode. ChangesmacOS notification signing
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant build_rs
participant helper_signing_mode
participant macos_notification_helper
build_rs->>helper_signing_mode: select signing setting and identity
helper_signing_mode-->>build_rs: return Disabled, AdHoc, or Release
build_rs->>macos_notification_helper: configure metadata and signature resources
build_rs->>macos_notification_helper: run codesign unless signing is Disabled
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The disabled, ad-hoc, and release signing paths remain consistent, with no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
| - name: cargo test (unsigned notifications) | ||
| env: | ||
| MISE_NOTIFICATION_SIGNING: disabled | ||
| run: mise x -- cargo test --all-features --ignore-rust-version system::history::notify |
There was a problem hiding this comment.
The added CI step runs cargo test through mise x, but the repository testing guide requires testing and linting commands to run through mise run. This repository requirement must be satisfied before merging by exposing the unsigned-notification test through an appropriate task and invoking it here.
Context Used: how to test the mise codebase (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
@jdx it seems to me the bot incorrectly detects this as an error, but the other CI tasks also use mise x -- cargo test. Let me know if this test should be a separate mise run task.
647a419 to
8d8abec
Compare
jdx
left a comment
There was a problem hiding this comment.
The additional unsigned-notification test forces a second macOS compilation. In the current CI run, that step took about 22 minutes, which is too expensive for exercising a small build-script branch and makes unit-macos substantially slower.
Please remove the additional workflow invocation. The signing-mode decision should instead be extracted into logic that can be covered by a cheap unit test in the existing test run. The existing macOS job already covers construction and execution of the notification helper; duplicating the mise build is not proportionate coverage for this change.
AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.
|
@jdx it makes sense to remove the duplicate test, done in 3f74c84 I've extracted the logic for deciding whether to enable/disable signing and added a test in 735d2cd, though perhaps I didn't understand your feedback, but IMO it doesn't seem to me that such test makes the most sense. I've done it in separate commits so it's easier to drop 735d2cd in case you'd rather not keep that test. |
|
Back to draft to resolve the conflicts with main. |
735d2cd to
18591d9
Compare
|
This PR currently has failing checks. If this continues for 7 days, it will be closed automatically. This is warning day 1 of 7. Please update the PR when you have a chance. Feel free to reopen or create a new PR if it is closed and you'd like to continue working on it. This comment was generated by an automated workflow. |
6eae61c to
192c1d7
Compare
|
This PR currently has failing checks. If this continues for 7 days, it will be closed automatically. This is warning day 1 of 7. Please update the PR when you have a chance. Feel free to reopen or create a new PR if it is closed and you'd like to continue working on it. This comment was generated by an automated workflow. |
192c1d7 to
a8155a5
Compare
|
This PR currently has failing checks. If this continues for 7 days, it will be closed automatically. This is warning day 1 of 7. Please update the PR when you have a chance. Feel free to reopen or create a new PR if it is closed and you'd like to continue working on it. This comment was generated by an automated workflow. |
Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
a8155a5 to
5c4f87b
Compare
|
@jdx I've addressed your feedback, let me know if there's anything else to fix, thanks. |
|
Thanks for reworking this — extracting the decision into a unit-testable selector and dropping the extra macOS build addresses my earlier review. I'd like to take the design in a different direction, though: I don't want contributors to have to set an env var to build mise. That's the part I'm not sold on. Nothing advertises Detect instead of opting inThe asymmetry that makes this safe:
So it's error handling on a command that already runs, rather than a new mode: let signed = codesign.arg(&app).output()?;
if !signed.status.success() {
if identity != "-" {
return Err(eyre!(
"failed to sign the macOS notification helper: {}",
String::from_utf8_lossy(&signed.stderr).trim()
));
}
println!("cargo:warning=codesign unavailable; building the notification helper unsigned (desktop notifications disabled)");
} else {
println!("cargo:rustc-cfg=mise_notification_has_signature_resources");
}Contributors in restricted environments just build, and nobody sets anything. The cost is that a genuine Releases must still fail loudly
I'd like the weaker half closed too: if that export is ever dropped or empty, the build quietly falls back to ad-hoc and ships a release with notifications disabled. That hole exists on Narrow the cfgSeparately, the #[cfg(mise_notification_has_signature_resources)]
const CODE_RESOURCES: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/mise-notify.app/Contents/_CodeSignature/CodeResources"));
#[cfg(not(mise_notification_has_signature_resources))]
const CODE_RESOURCES: &[u8] = &[];That plus gating the Packaging bug worth knowing about regardless
The direction above deletes that file, so this resolves itself — but flagging it in case any part of the module survives. Smaller
AI-assisted — Tool: Claude Code; model: Anthropic/claude-opus-5; version: 2.1.236. |
Unsigned source builds intentionally disable macOS notifications, but
build.rsstill unconditionally invokes/usr/bin/codesignandmacos.rsunconditionally embeds its generatedCodeResources.This prevents source builds in restricted environments where ad-hoc codesigning is unavailable, even though the resulting binary will not use notifications.
Add an explicit
MISE_NOTIFICATION_SIGNING=disabledmode. It:MISE_NOTIFICATION_RELEASE_SIGNED=0, so notifications remain disabledThe default ad-hoc and Developer ID signing paths are unchanged.
Summary by CodeRabbit
New Features
Bug Fixes