Detect non-cinnabar clones

RESOLVED FIXED

Status

MozReview
Integration: Git
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: gps, Assigned: timdream)

Tracking

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
A few people have attempted to configure MozReview using a gecko-dev / non-cinnabar clone of the Firefox repo. This results in an opaque error.

`git mozreview configure` should detect when the local repo isn't a cinnabar repo and error appropriately.

We should also update the docs to reflect how to obtain a cinnabar clone of the Firefox repo. Perhaps we could add content from glandium's blog post(s) to the Sphinx docs (or at least link to them).
Created attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

Review commit: https://reviewboard.mozilla.org/r/39149/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/39149/
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

Without understanding the underlining magic, this patch simply modifies the error and make it more descriptive. I don't really know what would cause the error other than a non-cinnabar clone -- if there isn't this should be good enough.
Attachment #8728803 - Flags: review?(gps)
Assignee: nobody → timdream
Status: NEW → ASSIGNED
After a little bit digging, I can confirm there isn't any other possibilities -- clone from a "Mercurial" "upstream" repo is indeed what to be asked here, since mozreview does expects a git hash to be found from a hg hash from `git cinnabar hg2git`.
(Reporter)

Comment 4

2 years ago
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

https://reviewboard.mozilla.org/r/39149/#review36065

I don't think exit code 1 necessarily means that we aren't using cinnabar. We should come up with something more intelligent here.
Attachment #8728803 - Flags: review?(gps)
(Reporter)

Comment 5

2 years ago
glandium: can you suggest the recommended way to detect a cinnabar repo? My guess would be to look for the ref used by cinnabar to store the sha-1 tree. But I'm not the cinnabar expert :)
Flags: needinfo?(mh+mozilla)
A non-empty output to git for-each-ref refs/cinnabar is probably the best forward-compatible way to check for that.
Flags: needinfo?(mh+mozilla)
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/39149/diff/1-2/
Attachment #8728803 - Attachment description: MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found → MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps
Attachment #8728803 - Flags: review?(gps)
(Reporter)

Comment 8

2 years ago
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

https://reviewboard.mozilla.org/r/39149/#review36099

::: git/commands/git-mozreview:618
(Diff revision 2)
> +            ui.warn('warning: please clone the repository from a Mercurial upstream, '
> +                    'instead of from a Git mirror\n')

Since we don't support non-cinnabar clones, this should be a fatal error. Please convert from ui.warn() to `raise AbortError('...')`.

Also, we should put "git-cinnabar" somewhere in the error message. Bonus points if you update the in-tree docs (see docs/ directory) and add a link to that. Docs are available at https://mozilla-version-control-tools.readthedocs.org/en/latest/
Attachment #8728803 - Flags: review?(gps)
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/39149/diff/2-3/
Attachment #8728803 - Flags: review?(gps)
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/39149/diff/3-4/
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/39149/diff/4-5/
(Reporter)

Comment 12

2 years ago
Comment on attachment 8728803 [details]
MozReview Request: Bug 1254249 - Provide a helpful description when Mercurial changesets can't be found, r=gps

https://reviewboard.mozilla.org/r/39149/#review36215

Looks good!
Attachment #8728803 - Flags: review?(gps) → review+
(Reporter)

Comment 13

2 years ago
Autolanded

https://hg.mozilla.org/hgcustom/version-control-tools/rev/7356b349ea9b
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.