Closed Bug 1183282 Opened 6 years ago Closed 6 years ago

Ability to mark repositories as read-only

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(2 files)

It would be convenient if we could mark old repositories as read only. It would also be convenient to put all of hg.mozilla.org in read-only mode during certain maintenances so we don't have to take the service offline to do upgrades.
Assignee: nobody → gps
Status: NEW → ASSIGNED
readonly: add an extension that marks repositories as read-only (bug 1183282); r?dminor

Lots of repositories on hg.mozilla.org are ancient and should no longer
be updated. In addition, it is desirable during some server
maintenance operations to prevent all pushes.

This commit introduces a new "readonly" extension that can be used to
mark repositories as read only. You can put a file in the .hg/ of an
individual repository to mark it read only. Or you can configure a
global read-only file to be used to mark all repositories as read only.
This satisfies both our major use cases.

It is unfortunate we can't hook into pretxnopen. However, the Mercurial
bug not showing output from this hook is a deal breaker :/
Attachment #8683363 - Flags: review?(dminor)
ansible/hg-ssh: install readonly extension (bug 1183282); r?dminor

Now that we have a basic readonly extension, configure it on
hg.mozilla.org.

We install the extension on the SSH server, which is the only place
where we need to be locking out writes.
Attachment #8683364 - Flags: review?(dminor)
Blocks: 1188219
Attachment #8683363 - Flags: review?(dminor) → review+
Comment on attachment 8683363 [details]
MozReview Request: readonly: add an extension that marks repositories as read-only (bug 1183282); r?dminor

https://reviewboard.mozilla.org/r/24301/#review21853

::: hgext/readonly/__init__.py:24
(Diff revision 1)
> +testedwith = '3.5 3.5'

Is 3.5 repeated here intentionally?

::: hgext/readonly/__init__.py:48
(Diff revision 1)
> +        # Repo local file does not exist. Fall through.

nit: unindent this comment and remove the following empty line so it is above
rf = ui.config(....
Comment on attachment 8683364 [details]
MozReview Request: ansible/hg-ssh: install readonly extension (bug 1183282); r?dminor

https://reviewboard.mozilla.org/r/24303/#review21855
Attachment #8683364 - Flags: review?(dminor) → review+
Deploying now.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.