Show commit mismatch warning in rwx results#389
Merged
Conversation
d7645eb to
a68dd19
Compare
jmsanders
previously approved these changes
Mar 2, 2026
cmd/rwx/results.go
Outdated
| if len(shortCommit) > 7 { | ||
| shortCommit = shortCommit[:7] | ||
| } | ||
| return fmt.Sprintf("Note: you're currently on commit %s but the most recent run on this branch was for commit %s", shortHead, shortCommit) |
Contributor
There was a problem hiding this comment.
Do we use "Note:" consistently elsewhere? I see it in just one other info message.
Contributor
Author
There was a problem hiding this comment.
Not really, though Warning: felt a bit too strong here. 🤷
cmd/rwx/results.go
Outdated
| if len(shortCommit) > 7 { | ||
| shortCommit = shortCommit[:7] | ||
| } | ||
| return fmt.Sprintf("Note: you're currently on commit %s but the most recent run on this branch was for commit %s", shortHead, shortCommit) |
Contributor
There was a problem hiding this comment.
I know we sort of brushed it off at standup, but I do think it could be a bit confusing if you've:
- kicked off a run that gets git patched
- committed
- now the most recent results will show this note even if it's the same code
I think this is fine as is but let's keep an eye on how it feels when we actually use it.
Contributor
Author
There was a problem hiding this comment.
Hmm yeah very interesting
When `rwx results` infers a run from the current branch, compare the local HEAD against the commit SHA the server reports the run was built from. If they differ, print a note so the user knows the results may not reflect their current working tree.
a68dd19 to
c6ebf1d
Compare
jmsanders
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rwx resultsinfers a run from the current branch, compares the local HEAD against the commit SHA the run was built fromNote: you're currently on commit a1b2c3d but the most recent run on this branch was for commit b2c3d4ecommit_shafield toRunStatusResultAPI response (nullable)Test plan
go build ./cmd/rwxcompilesgo test ./internal/... ./cmd/...passesrwx resultson a branch where HEAD matches the run's commit — no warning shownrwx resultson a branch where HEAD differs from the run's commit — warning shownrwx results <run-id>— no warning shown (explicit ID skips check)rwx results --output json— no warning shown (JSON mode)