Closed Bug 1978262 Opened 1 year ago Closed 1 year ago

allow new root for tags-unified branch of m-u, m-r, m-b and esrs

Categories

(Developer Services :: Mercurial: hg.mozilla.org, task)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: shtrom, Assigned: shtrom)

References

Details

Attachments

(2 files)

remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: *** pushing unrelated repository ***
remote: 
remote: Changeset acfb15b84578 introduces a new root changeset into this repository. This
remote: almost certainly means you accidentally force pushed to the wrong
remote: repository and/or URL.
remote: 
remote: Your push is being rejected because this is almost certainly not what you
remote: intended.
remote: transaction abort!
remote: rollback completed

We should disable the hook on one repo, see what root it pushes, then allow-list that for all and re-enable the hook.

Can we know the root commit id ahead of time, and just allow-list that?

I have trimmed the duplicates from the branch, that came from repeatedly processing the tags message and creating the tag in the .hgtags branch (due to https://github.com/glandium/git-cinnabar/issues/354), but then failing to push them leading to the message getting re-processed.

$ git branch -M tags-unified tags-unified-dupes
$ git log tags-unified-dupes
$ git branch tags-unified 812bc458f67642a50b53e882ff46149a6684ef2a

Can we know the root commit id ahead of time, and just allow-list that?

The dry-run itself didn't work. glandium suggested to force it, but that didn't help.

app@git-hg-sync-worker-0:/clones/firefox$ git -c cinnabar.check=traceback push --dry-run  hg::ssh://hg.mozilla.org/releases/mozilla-release/ tags-unified:refs/heads/branches/tags-unified/tip
To hg::ssh://hg.mozilla.org/releases/mozilla-release/
 ! [remote rejected]             tags-unified -> branches/tags-unified/tip (Cannot push to this remote without pulling/updating first)
error: failed to push some refs to 'hg::ssh://hg.mozilla.org/releases/mozilla-release/'
app@git-hg-sync-worker-0:/clones/firefox$ git cinnabar git2hg tags-unified
0000000000000000000000000000000000000000
app@git-hg-sync-worker-0:/clones/firefox$ git -c cinnabar.check=traceback push -f  --dry-run  hg::ssh://hg.mozilla.org/releases/mozilla-release/ tags-unified:refs/heads/branches/tags-unified/tip
WARNING Pushing a new root
To hg::ssh://hg.mozilla.org/releases/mozilla-release/
 * [new branch]                  tags-unified -> branches/tags-unified/tip
app@git-hg-sync-worker-0:/clones/firefox$ git cinnabar git2hg tags-unified
0000000000000000000000000000000000000000

We could just push the root to a throw-away repo...

Depends on: 1975130

I disabled the hook for conduit-testing/infra-testing, with this in the mozilla section of its .hg/hgrc.

[mozilla]
...
# Bug 1978262.
check.single_root = disable
Assignee: nobody → omehani
Status: NEW → ASSIGNED

Solution found: -c cinnabar.data=force as per https://github.com/glandium/git-cinnabar?tab=readme-ov-file#avoiding-metadata

So we need

  1. single_root hook disabled
  2. -c cinnabar.data=force for cinnabar to update the commit IDs
  3. --dry-run to not actually push the changes
  4. -f to ignore Hg's warning about creating new roots
pp@git-hg-sync-worker-0:/clones/firefox.bug1978262$ git cinnabar git2hg $(git rev-parse tags-unified)
0000000000000000000000000000000000000000
app@git-hg-sync-worker-0:/clones/firefox.bug1978262$ git -c cinnabar.check=traceback -c cinnabar.data=force push --force     --dry-run  hg::ssh://hg.mozilla.org/conduit-testing/infra-testing tags-unified:refs/heads/branches/tags-unified/tip
WARNING Pushing a new root
Bundling 1 changesets
Bundling 1 manifests
Bundling 1 revisions of 1 files
Updating metadata...
To hg::ssh://hg.mozilla.org/conduit-testing/infra-testing
 * [new branch]                  tags-unified -> branches/tags-unified/tip
Unpacking objects: 100% (21/21), 160.31 KiB | 2.26 MiB/s, done.
app@git-hg-sync-worker-0:/clones/firefox.bug1978262$ git cinnabar git2hg $(git rev-parse tags-unified)
acfb15b84578d7e04524802146c792c8742a95b7

The root to allow-list is acfb15b84578d7e04524802146c792c8742a95b7

Suggestion to proceed:

For each of the repos:

  • releases/mozilla-beta
  • mozilla-central
  • releases/mozilla-esr115
  • releases/mozilla-esr128
  • releases/mozilla-esr140
  • releases/mozilla-release

Edit their .hg/hgrc to add the following section, or to it if it's already present:

[allowedroots]
8ba995b74e18334ab3707f27e9eb8f4e37ba3d29 = acfb15b84578d7e04524802146c792c8742a95b7

8ba995b74e18334ab3707f27e9eb8f4e37ba3d29 is the rev 0 changeset of mozilla-unified and other forks

ni: :sheehan for r?

Flags: needinfo?(sheehan)

Adding allowed_root to system-wide hgrc with ansible instead.

Summary: allow new roots for tags branch of m-u, m-r, m-b and esrs → allow new root for tags-unified branch of m-u, m-r, m-b and esrs
Flags: needinfo?(sheehan)
Attachment #9501971 - Attachment description: hgssh: add tags-unified root to firefox allowed_root (Bug 1978262) r?sheehan,jcristau → hgssh: add tags-unified root to firefox allowedroots (Bug 1978262) r?sheehan,jcristau

Pushed by omehani@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/a71dcc36e31b
hgssh: add tags-unified root to firefox allowedroots r=sheehan,jcristau

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

These were added to hgrc in individual repositories, which cause the global
config to be overridden and ignored. Merge this in so we can clean up
the repo-specific configs (mostly for documentation purposes since these
commits were already pushed at this point).

Pushed by jcristau@mozilla.com: https://hg.mozilla.org/hgcustom/version-control-tools/rev/169485a899ff hg-ssh: add allowed roots from the firefox-android migration . r=sheehan
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: