Skip to contentSkip to conversation

Next steps from GTI TAC meeting on 2023-03-08 - Evaluate cost of glibc migration.

DISCUSSION Joseph Myers 6 participants 29 messages May 19, 2023 – May 25, 2023

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Konstantin Ryabitsev

Our mailing list infrastructure is uniquely tailored to public-inbox users, with messages being written to the archives *before* they are even sent out to subscribers, which helps speed up access for users who aren't using the

There is a certain advantage there regarding the problem we currently have where messages sent as HTML are missing from public-inbox archives, if the process that strips HTML parts takes place before feeding to public-inbox (whereas at present it takes place after that, I think).

(I consider it important that we do *not* insist on contributors meeting a shibboleth of sending plain-text email before they can interact with our mailing lists, especially for user lists such as libc-help - we should be friendly to people sending email in the ordinary form they are used to using today even if we might rather they didn't send HTML email - we shouldn't impose that view of proper email on them.)

Quoted 5 lines

The major improvement of this vs. bugzilla's native email interface is that bugs can be created from mailing list discussions, not just the other way around. The bugbot will need to be slightly adjusted for CTI needs, but otherwise I think it would be a better solution than Bugzilla's native email integration. For example, when bugmail is sent to the mailing list and someone

Note that people can send email to Bugzilla in reply to a message they received directly from Bugzilla - not just in reply to a message on glibc-bugs. I think it's important that both cases of replying should work automatically, however that's implemented.

(If someone replies to a glibc-bugs message and forgets to remove glibc-bugs from their reply, the list gets two copies of the message at present - one that the user sent directly, one forwarded by Bugzilla. Avoiding that duplication somehow would be nice to have, but entirely optional.)

Note also that Bugzilla is one of the hardest migration issues (for non-GCC projects), because (as I mentioned in one of the meetings) Sourceware Bugzilla is used by many different projects, most of which are not part of CTI.

Quoted 5 lines

* Sending per-commit email to mailing lists -- this seems like a vestigial feature from the pre-git past. Does it really serve any purpose? I am fighting to kill a similar feature used on the kernel.org side, because I do not see any remaining legitimate use for it -- it just creates a lot of mail traffic that nobody really reviews.

I think it's extremely useful to have those messages for watching out for commits that shouldn't have gone in or went in in an unintended form (this is for human-determined "shouldn't" or "unintended" - not anything expected to be covered by automated checks). And also to have a message ready-made to reply to when something was committed without being posted to the mailing list.

Quoted 9 lines

* We do not currently allow direct hooks on the server side, because running arbitrary scripts with the permissions of the git server is a very bad anti-pattern when it comes to repo security. It also tends to make pushes super slow and frustrating to developers, especially those working on slow or unstable connections that can go rapidly stale, resulting in failed pushes.

So, we will need to wrap our collective heads around what your hooks are doing now and implement them via alternative means. For example:

Certainly some kind of system for proxying / containing checks to limit what they can do if buggy makes sense - they don't need to run with the permissions of the git server, they can run in some kind of isolation, as long as they prevent bad commits from getting into the history.

Quoted 2 lines

* denying force-pushes to specific branches (rebase/non-fast-forward updates) is a native feature of Gitolite

What about denying merge commits on master and release branches?

Note that GCC has its own custom set of namespaces for branches (under refs/users/ and refs/vendors/) and rules about what branch names may be created at all etc. (Unfortunately there seem to be some missing checks for the case of lightweight tag creation, resulting in some improperly named tags being present.)

Quoted 3 lines

The only thing that would require more work is style checkers and other CI functionality that really should not be happening on-push. I suggest that this moves entirely to patchwork CI, discussed below.

I think those things *should* be happening on push - to prevent obviously bad history getting onto master or release branches (at least) in the first place. For glibc, that's (apart from the non-fast-forward checks and rejecting merge commits on branches meant to have linear history):

* Disallowing lines with trailing whitespace in certain files.

* Disallowing commits with a mailing list address as the author email (even if your mailing list setup is designed to be DKIM-safe so author emails don't need rewriting, people might still use "git am" with old messages, so this remains relevant).

* Disallowing commit subject lines that look like a ChangeLog header.

* Disallowing single-word (or empty) commit subject lines.

For GCC there are several extra checks that I enumerated - including, in particular, the fairly complicated checks for ChangeLog format to avoid the nightly cron job updating ChangeLogs falling over. (The check to avoid From-SVN: lines is similarly to prevent a commit that would cause subsequent problems for automation that relies on those lines only being present in commits converted from SVN in order to look up such a commit by SVN commit number.)

Quoted 7 lines

## Release tarballs

There are multiple ways of getting this done, including completely automated. For example, stable kernel releases are generated server-side by using and verifying the PGP signature found in a git note attached to the release tag. This doesn't work if the tarball is not directly generated from a git repository (for example, if config scripts must run first).

Is "git archive" output or similar actually stable enough that the server can reliably generate (at any time in the future, with a future git version) a tarball matching the tarball signature the release manager generated at release time, or is that not what you meant?

I'd certainly expect the tarballs served as release tarballs to be byte-for-byte identical to the ones at https://ftp.gnu.org/gnu/glibc/ (and the signatures likewise to be identical).

Signature · 2 lines
Joseph S. Myers
[email protected]
#1 lore raw
Quoted 6 lines
Quoted 5 lines

* Sending per-commit email to mailing lists -- this seems like a vestigial feature from the pre-git past. Does it really serve any purpose? I am fighting to kill a similar feature used on the kernel.org side, because I do not see any remaining legitimate use for it -- it just creates a lot of mail traffic that nobody really reviews.

Quoted 6 lines

I think it's extremely useful to have those messages for watching out for commits that shouldn't have gone in or went in in an unintended form (this is for human-determined "shouldn't" or "unintended" - not anything expected to be covered by automated checks). And also to have a message ready-made to reply to when something was committed without being posted to the mailing list.

I strongly agree as well.

Signature · 1 line
Joel
#2 lore raw
Quoted 6 lines · Joel Brobecker
Quoted 6 lines
Quoted 5 lines

* Sending per-commit email to mailing lists -- this seems like a vestigial feature from the pre-git past. Does it really serve any purpose? I am fighting to kill a similar feature used on the kernel.org side, because I do not see any remaining legitimate use for it -- it just creates a lot of mail traffic that nobody really reviews.

Quoted 9 lines
Quoted 6 lines

I think it's extremely useful to have those messages for watching out for commits that shouldn't have gone in or went in in an unintended form (this is for human-determined "shouldn't" or "unintended" - not anything expected to be covered by automated checks). And also to have a message ready-made to reply to when something was committed without being posted to the mailing list.

I strongly agree as well.

Likewise, I do post-commit review using the per-commit emails.

Even if we had an advanced process to review and merge code that process still needs a belt-and-suspenders review from senior maintainers, and I do that by reviewing and often responding to the per-commit emails to loop in the people that committed the code.

The question for me is "What is lower cost?"

(a) Walking the git commit history, making a note of where I stopped and started, and then writing net new emails when I see something that needs correctly.
(b) Reviewing an mbox, deleting as required, and reply-all when I see something that needs review.

I like the per-commit emails because it lets me have some post-commit discussions easily e.g. (b).

Signature · 2 lines
Cheers,
Carlos.
#3 lore raw
Quoted 9 lines · Carlos O'Donell

Likewise, I do post-commit review using the per-commit emails.

Even if we had an advanced process to review and merge code that process still needs a belt-and-suspenders review from senior maintainers, and I do that by reviewing and often responding to the per-commit emails to loop in the people that committed the code.

The question for me is "What is lower cost?"

Quoted 7 lines

(a) Walking the git commit history, making a note of where I stopped and started, and then writing net new emails when I see something that needs correctly.
(b) Reviewing an mbox, deleting as required, and reply-all when I see something that needs review.

I like the per-commit emails because it lets me have some post-commit discussions easily e.g. (b).

Couldn't you use patchwork for this, filtering on Committed state? If we have 100% coverage (sending non-matching commits to the ML will achieve that), you would be able to look through committed patches and then start the conversation in the patch thread instead of a separate one through glibc-cvs.

If noting where you stopped/started is cumbersome then you could add another Audited terminal state in patchwork to track that.

Thanks,
Sid

#4 lore raw
Quoted 15 lines · Siddhesh Poyarekar
Quoted 14 lines · Carlos O'Donell

Likewise, I do post-commit review using the per-commit emails.

Even if we had an advanced process to review and merge code that process still needs a belt-and-suspenders review from senior maintainers, and I do that by reviewing and often responding to the per-commit emails to loop in the people that committed the code.

The question for me is "What is lower cost?"

(a) Walking the git commit history, making a note of where I stopped and started, and then writing net new emails when I see something that needs correctly. (b) Reviewing an mbox, deleting as required, and reply-all when I see something that needs review.

Quoted 8 lines
Quoted 2 lines

I like the per-commit emails because it lets me have some post-commit discussions easily e.g. (b).

Couldn't you use patchwork for this, filtering on Committed state? If we have 100% coverage (sending non-matching commits to the ML will achieve that), you would be able to look through committed patches and then start the conversation in the patch thread instead of a separate one through glibc-cvs.

Is 100% coverage an achievable and timely goal? :-)

I think that Patchwork *could* meet this need but isn't quite there yet.

Quoted 2 lines

If noting where you stopped/started is cumbersome then you could add another Audited terminal state in patchwork to track that.

That would need to be a per-reviewer state that doesn't exist today in patchwork.

The Audited terminal state would be global, and Joseph and I notice different things in our reviews and apply different criteria for calling out a patch that needs follow up work or review.

In summary:

- Post-commit review facilitation for projects continues to be a value-add step in the maintainer process and is currently mbox-based.

- The bar for post-commit review today is an mbox review-style process and a replacement needs to handle multiple reviewers walking the queue at different rates and applying different criteria to review (tag-based scheme?)

Signature · 2 lines
Cheers,
Carlos.
#5 lore raw
Quoted 1 line · Carlos O'Donell

Is 100% coverage an achievable and timely goal? :-)

It's an achievable, timely *and* trivial goal if we post missing commits (i.e. commits in git without a matching patch on libc-alpha) to libc-alpha as [pushed].

Quoted 11 lines

I think that Patchwork *could* meet this need but isn't quite there yet.

Quoted 2 lines

If noting where you stopped/started is cumbersome then you could add another Audited terminal state in patchwork to track that.

That would need to be a per-reviewer state that doesn't exist today in patchwork.

The Audited terminal state would be global, and Joseph and I notice different things in our reviews and apply different criteria for calling out a patch that needs follow up work or review.

Quoted 8 lines

In summary:

- Post-commit review facilitation for projects continues to be a value-add step in the maintainer process and is currently mbox-based.

- The bar for post-commit review today is an mbox review-style process and a replacement needs to handle multiple reviewers walking the queue at different rates and applying different criteria to review (tag-based scheme?)

Wouldn't a [pushed] email to libc-alpha provide more visibility then, given that multiple people (I do too, albeit infrequently) tend to review these commits? It shouldn't need a separate mailing list, given our email traffic volume. Basically:

- Commits to the main branch go to libc-alpha
- Commits to release/* branches go to libc-stable
- All other commits (i.e. to private branches) get ignored.

Thanks,
Sid

#6 lore raw
In reply to Joseph Myers
Quoted 8 lines · Joseph Myers
Quoted 3 lines

Our mailing list infrastructure is uniquely tailored to public-inbox users, with messages being written to the archives *before* they are even sent out to subscribers, which helps speed up access for users who aren't using the

There is a certain advantage there regarding the problem we currently have where messages sent as HTML are missing from public-inbox archives, if the process that strips HTML parts takes place before feeding to public-inbox (whereas at present it takes place after that, I think).

Hm... no, there is no "stripping of HTML parts" (that would invalidate DKIM). It is certainly possible to configure a mailing list so that HTML messages are pre-moderated.

Quoted 6 lines

(I consider it important that we do *not* insist on contributors meeting a shibboleth of sending plain-text email before they can interact with our mailing lists, especially for user lists such as libc-help - we should be friendly to people sending email in the ordinary form they are used to using today even if we might rather they didn't send HTML email - we shouldn't impose that view of proper email on them.)

It's possible, but it is an empirical fact that permitting HTML messages raises the amount of spam that goes through by several orders of magnitude. Allowing it per-list is okay and normal (e.g. the list aimed at newbies and people seeking occasional help). However, I think it is perfectly normal to disallow it on development lists where one is already expected to follow a fairly rigid set of rules.

Quoted 6 lines
Quoted 5 lines

* Sending per-commit email to mailing lists -- this seems like a vestigial feature from the pre-git past. Does it really serve any purpose? I am fighting to kill a similar feature used on the kernel.org side, because I do not see any remaining legitimate use for it -- it just creates a lot of mail traffic that nobody really reviews.

Quoted 6 lines

I think it's extremely useful to have those messages for watching out for commits that shouldn't have gone in or went in in an unintended form (this is for human-determined "shouldn't" or "unintended" - not anything expected to be covered by automated checks). And also to have a message ready-made to reply to when something was committed without being posted to the mailing list.

If you insist, though I still think this is the case of "everyone assumes that someone else is paying attention to it." I am highly critical of setups that fire messages into the ether in hopes that someone checks them.

There are better ways of doing it that don't generate email, e.g.:

- compare commits against patchwork and alert when there is no match
- write all pushes to an audit log and have someone monitor it (e.g. see https://tlog.linderud.dev/)
- monitor the RSS feed of all commits (e.g.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/atom/?h=master)

Quoted 7 lines
Quoted 7 lines

* We do not currently allow direct hooks on the server side, because running arbitrary scripts with the permissions of the git server is a very bad anti-pattern when it comes to repo security. It also tends to make pushes super slow and frustrating to developers, especially those working on slow or unstable connections that can go rapidly stale, resulting in failed pushes.

Quoted 7 lines
Quoted 2 lines

So, we will need to wrap our collective heads around what your hooks are doing now and implement them via alternative means. For example:

Certainly some kind of system for proxying / containing checks to limit what they can do if buggy makes sense - they don't need to run with the permissions of the git server, they can run in some kind of isolation, as long as they prevent bad commits from getting into the history.

That would take even longer to execute, and be more fragile, no? I usually get lots of push-back from developers when their pushes don't return within a second or two, so having a push take many minutes to complete seems like bad user experience.

Quoted 4 lines
Quoted 2 lines

* denying force-pushes to specific branches (rebase/non-fast-forward updates) is a native feature of Gitolite

What about denying merge commits on master and release branches?

I'm not sure I understand -- you mean, all commits must have a single parent and have a fully linear structure? Doesn't that make it super difficult to resolve conflicts?

Sorry, I'm coming from the opposite world where merge commits are encouraged -- the cover letter of the series goes into the merge commit, and therefore carries changelogs and links to all previous revisions of the series that got applied.

Quoted 5 lines

Note that GCC has its own custom set of namespaces for branches (under refs/users/ and refs/vendors/) and rules about what branch names may be created at all etc. (Unfortunately there seem to be some missing checks for the case of lightweight tag creation, resulting in some improperly named tags being present.)

As long as it works with git, that's not a problem -- but I believe a lot of visualization tools (like cgit) won't display anything that's not under refs/heads.

Quoted 7 lines

I think those things *should* be happening on push - to prevent obviously bad history getting onto master or release branches (at least) in the first place. For glibc, that's (apart from the non-fast-forward checks and rejecting merge commits on branches meant to have linear history):

* Disallowing lines with trailing whitespace in certain files.

Quoted 8 lines

* Disallowing commits with a mailing list address as the author email (even if your mailing list setup is designed to be DKIM-safe so author emails don't need rewriting, people might still use "git am" with old messages, so this remains relevant).

* Disallowing commit subject lines that look like a ChangeLog header.

* Disallowing single-word (or empty) commit subject lines.

In my view these all should be happening on the client as pre-commit checks, not on the server. Any reason why they can't run on the client, e.g. via a framework like https://pre-commit.com/ ?

Quoted 7 lines

For GCC there are several extra checks that I enumerated - including, in particular, the fairly complicated checks for ChangeLog format to avoid the nightly cron job updating ChangeLogs falling over. (The check to avoid From-SVN: lines is similarly to prevent a commit that would cause subsequent problems for automation that relies on those lines only being present in commits converted from SVN in order to look up such a commit by SVN commit number.)

Also something that, in my view, should be running pre-commit on the client.

Quoted 8 lines
Quoted 7 lines

## Release tarballs

There are multiple ways of getting this done, including completely automated. For example, stable kernel releases are generated server-side by using and verifying the PGP signature found in a git note attached to the release tag. This doesn't work if the tarball is not directly generated from a git repository (for example, if config scripts must run first).

Quoted 4 lines

Is "git archive" output or similar actually stable enough that the server can reliably generate (at any time in the future, with a future git version) a tarball matching the tarball signature the release manager generated at release time, or is that not what you meant?

It's stable enough to not have changed in a decade, but we also only need compatibility within a short period of time. We generate the tarball from the git-note signature once, shortly after it is pushed. We don't need to be able to generate the same tarball years later. Once the tarball is generated, it is put into the primary storage and kept there.

-K

#7 lore raw
Quoted 7 lines · Konstantin Ryabitsev
Quoted 6 lines

(I consider it important that we do *not* insist on contributors meeting a shibboleth of sending plain-text email before they can interact with our mailing lists, especially for user lists such as libc-help - we should be friendly to people sending email in the ordinary form they are used to using today even if we might rather they didn't send HTML email - we shouldn't impose that view of proper email on them.)

Quoted 6 lines

It's possible, but it is an empirical fact that permitting HTML messages raises the amount of spam that goes through by several orders of magnitude. Allowing it per-list is okay and normal (e.g. the list aimed at newbies and people seeking occasional help). However, I think it is perfectly normal to disallow it on development lists where one is already expected to follow a fairly rigid set of rules.

The toolchain lists universally allow mail from non-subscribers, and I think most can expect sometimes to be included in discussions involving people who are not particularly active developers of that particular project (but may still be relevant to include in that individual discussion).

When allowing HTML through to the lists (with or without any form of moderation) we should make sure public-inbox properly archives those messages that include HTML.

Quoted 3 lines

If you insist, though I still think this is the case of "everyone assumes that someone else is paying attention to it." I am highly critical of setups that fire messages into the ether in hopes that someone checks them.

People do in practice monitor the commit emails.

Quoted 1 line

There are better ways of doing it that don't generate email, e.g.:

For projects using email for development, commit emails have the obvious advantage of not adding yet another different system to watch.

Quoted 4 lines
Quoted 1 line

What about denying merge commits on master and release branches?

I'm not sure I understand -- you mean, all commits must have a single parent and have a fully linear structure?

Yes. We use linear history (on master and release branches) for GCC and glibc. (Shared development branches use merge commits for merging master into the branch. Ones in the users and vendors namespaces might use merges or might be rebased, depending on the policy for the individual branch.)

Quoted 1 line

Doesn't that make it super difficult to resolve conflicts?

No.

Quoted 12 lines
Quoted 12 lines

I think those things *should* be happening on push - to prevent obviously bad history getting onto master or release branches (at least) in the first place. For glibc, that's (apart from the non-fast-forward checks and rejecting merge commits on branches meant to have linear history):

* Disallowing lines with trailing whitespace in certain files.

* Disallowing commits with a mailing list address as the author email (even if your mailing list setup is designed to be DKIM-safe so author emails don't need rewriting, people might still use "git am" with old messages, so this remains relevant).

Quoted 7 lines
Quoted 3 lines

* Disallowing commit subject lines that look like a ChangeLog header.

* Disallowing single-word (or empty) commit subject lines.

In my view these all should be happening on the client as pre-commit checks, not on the server. Any reason why they can't run on the client, e.g. via a framework like https://pre-commit.com/ ?

A server can't ensure that the user's clone has any particular custom configuration. We have some optional configuration (gcc-git-customization.sh), but there's no requirement to use it. Checking on push is much more reliable than expecting custom configuration on the user's side.

Signature · 2 lines
Joseph S. Myers
[email protected]
#8 lore raw
Quoted 13 lines · Joseph Myers
Quoted 6 lines

It's possible, but it is an empirical fact that permitting HTML messages raises the amount of spam that goes through by several orders of magnitude. Allowing it per-list is okay and normal (e.g. the list aimed at newbies and people seeking occasional help). However, I think it is perfectly normal to disallow it on development lists where one is already expected to follow a fairly rigid set of rules.

The toolchain lists universally allow mail from non-subscribers, and I think most can expect sometimes to be included in discussions involving people who are not particularly active developers of that particular project (but may still be relevant to include in that individual discussion).

Quoted 3 lines

When allowing HTML through to the lists (with or without any form of moderation) we should make sure public-inbox properly archives those messages that include HTML.

Yes, that's always been the case -- public-inbox does not do any filtering, it just archives whatever the mailing list allows through.

Quoted 5 lines
Quoted 3 lines

If you insist, though I still think this is the case of "everyone assumes that someone else is paying attention to it." I am highly critical of setups that fire messages into the ether in hopes that someone checks them.

People do in practice monitor the commit emails.

Okay, if you insist -- after all, we do the same thing for all kernel commits. I just find it a pretty terrible waste of resources, as I'm pretty sure 99% of everyone who subscribes to that list has set things up to go to a folder that they never check.

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

I think those things *should* be happening on push - to prevent obviously bad history getting onto master or release branches (at least) in the first place. For glibc, that's (apart from the non-fast-forward checks and rejecting merge commits on branches meant to have linear history):

* Disallowing lines with trailing whitespace in certain files.

* Disallowing commits with a mailing list address as the author email (even if your mailing list setup is designed to be DKIM-safe so author emails don't need rewriting, people might still use "git am" with old messages, so this remains relevant).

* Disallowing commit subject lines that look like a ChangeLog header.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

* Disallowing single-word (or empty) commit subject lines.

In my view these all should be happening on the client as pre-commit checks, not on the server. Any reason why they can't run on the client, e.g. via a framework like https://pre-commit.com/ ?

A server can't ensure that the user's clone has any particular custom configuration.

Okay, perhaps I'm not fully grokking the picture. How many people are able to push to master/release branches? I was expecting it to be 1-2, maybe a handful of people, but perhaps it's a much wider set of developers?

-K

#9 lore raw
Quoted 3 lines · Konstantin Ryabitsev

Okay, perhaps I'm not fully grokking the picture. How many people are able to push to master/release branches? I was expecting it to be 1-2, maybe a handful of people, but perhaps it's a much wider set of developers?

There are 612 users in the gcc group. There are 121 users in the glibc group. There are 461 users in the src group (which can commit to the binutils-gdb repository). (Obviously there's a lot of overlap between the users in those groups - people who have commit access to more than one project.) There are no technical restrictions on which users in the right group can push to which branch; there are of course policies on patch approval before pushing, but mostly they are not enforced by technical means.

(It would be reasonable to e.g. only set up commit access on the new system automatically for users who have pushed to a repository within the past year or two - something that could be identified most reliably from the archives of the commit mailing lists, converting back from the committer information in each commit to a Sourceware username would be more complicated - and wait for others to request restoration of commit access.)

Signature · 2 lines
Joseph S. Myers
[email protected]
#10 lore raw
Quoted 9 lines · Joseph Myers
Quoted 3 lines · Konstantin Ryabitsev

Okay, perhaps I'm not fully grokking the picture. How many people are able to push to master/release branches? I was expecting it to be 1-2, maybe a handful of people, but perhaps it's a much wider set of developers?

There are 612 users in the gcc group. There are 121 users in the glibc group. There are 461 users in the src group (which can commit to the binutils-gdb repository).

Okay, clearly a totally different approach to the kernel world where only a single person (or perhaps 2-3 people) can write to a repository like torvalds/linux.git or stable/linux.git. Hence my misunderstanding of what is happening.

Can you please describe the lifecycle of a patch and how it gets from "user sends a change to the mailing list" to "that patch becomes a commit in the official project repository where it lives forever."

E.g. for the kernel, it is:

- the patch receives initial review by the subsystem maintainer
- after a few iterations, the patch is committed to that maintainer's separate repository (either on kernel.org or elsewhere)
- during the merge window, the maintainer sends a pull request to the mainline maintainer (Linus) who does a final review and either rejects it or merges it into the mainline

I need to more clearly understand the kind of access 612 users of the gcc group have to the git repository.

-K

#11 lore raw
Quoted 3 lines · Konstantin Ryabitsev

Can you please describe the lifecycle of a patch and how it gets from "user sends a change to the mailing list" to "that patch becomes a commit in the official project repository where it lives forever."

A patch is sent to the list. There are some number of review / revision rounds, ending with a reviewer or maintainer saying it is OK to commit (or OK after some specified changes, or OK in the absence of objections within some given period, etc.). If the person posting the patch has commit access, they commit it; otherwise they should ask the maintainer to do so for them. Maintainers of parts of the compiler may commit their patches without someone else reviewing them. (There are also reviewers who can approve other people's patches in their area of the compiler but not their own - and global reviewers can approve patches anywhere in the compiler.) Once someone has had a few good patches approved and committed by someone else, they'll probably be asked to complete the form for getting commit access, naming the relevant maintainer as approver (only maintainers can approve commit access, non-maintainers with commit access can't do so).

Anyone with commit access can create their own branches in their refs/users/ namespace if they wish, and use them without needing review for commits going there. Shared development branches under refs/heads/devel/ have whatever rules are established by the people setting up those branches.

Rules about patch approval are not enforced automatically, only the basic checks for certain kinds of problems with commits and for such things as non-fast-forward pushes only being allowed in namespaces such as refs/users/ and refs/vendors/.

The above is for GCC, but the general idea is similar for other projects, with differences of detail in the ref namespaces used, the checks carried out on commits and exactly how maintainership works.

Signature · 2 lines
Joseph S. Myers
[email protected]
#12 lore raw
Quoted 11 lines · Joseph Myers
Quoted 3 lines

Can you please describe the lifecycle of a patch and how it gets from "user sends a change to the mailing list" to "that patch becomes a commit in the official project repository where it lives forever."

A patch is sent to the list. There are some number of review / revision rounds, ending with a reviewer or maintainer saying it is OK to commit (or OK after some specified changes, or OK in the absence of objections within some given period, etc.). If the person posting the patch has commit access, they commit it; otherwise they should ask the maintainer to do so for them. Maintainers of parts of the compiler may commit their patches without someone else reviewing them.

This workflow has one important problem -- you must ultimately trust the integrity of your infrastructure. It would be very easy for a malicious actor with access to backend infrastructure to insert a commit into the repository without it being discovered:

1. they can override any server-side validations
2. they can disable email notifications
3. they can forge the Committer identity of the commit

With your current workflow nobody would find out that such commit has been inserted into the history because everyone must rebase their commits anyway, so having a push rejected due to newer remote commits is a routine situation (as opposed to a being a huge red flag in a repository where only one or two committers are allowed to write).

Similarly, since most commits end up being rebased, there can be no post-fact validation to find out if there are any commits that did not go through review -- their patch-id would likely no longer match the mailing list submission anyway (at least, there would be too many false-positives).

This situation could be partially mitigated if commits were cryptographically signed, but they don't appear to be.

GCC and other projects are sufficiently high targets that we should not trust the infrastructure to be secure or admins to be above being bribed or forced under duress.

Quoted 5 lines

Anyone with commit access can create their own branches in their refs/users/ namespace if they wish, and use them without needing review for commits going there. Shared development branches under refs/heads/devel/ have whatever rules are established by the people setting up those branches.

From the git backend perspective, this is not optimal, because the resulting packs contain extra objects that aren't interesting to most cloners. For example, if I only leave refs/heads and refs/tags in the gcc repository, I get rid of over 1.1 million extra objects (from 3.9 million to 2.8 million) and the pack shrinks from 1.8GB to 1.1GB.

To me, it makes more sense to separate this into multiple repositories and relegate vendor/user branches to their own trees. They still share objects behind the scenes, but packs and cloning is much more optimized.

-K

#13 lore raw
Quoted 33 lines · Konstantin Ryabitsev
Quoted 11 lines · Joseph Myers
Quoted 3 lines

Can you please describe the lifecycle of a patch and how it gets from "user sends a change to the mailing list" to "that patch becomes a commit in the official project repository where it lives forever."

A patch is sent to the list. There are some number of review / revision rounds, ending with a reviewer or maintainer saying it is OK to commit (or OK after some specified changes, or OK in the absence of objections within some given period, etc.). If the person posting the patch has commit access, they commit it; otherwise they should ask the maintainer to do so for them. Maintainers of parts of the compiler may commit their patches without someone else reviewing them.

This workflow has one important problem -- you must ultimately trust the integrity of your infrastructure. It would be very easy for a malicious actor with access to backend infrastructure to insert a commit into the repository without it being discovered:

1. they can override any server-side validations
2. they can disable email notifications
3. they can forge the Committer identity of the commit

With your current workflow nobody would find out that such commit has been inserted into the history because everyone must rebase their commits anyway, so having a push rejected due to newer remote commits is a routine situation (as opposed to a being a huge red flag in a repository where only one or two committers are allowed to write).

Similarly, since most commits end up being rebased, there can be no post-fact validation to find out if there are any commits that did not go through review -- their patch-id would likely no longer match the mailing list submission anyway (at least, there would be too many false-positives).

Quoted 6 lines

This situation could be partially mitigated if commits were cryptographically signed, but they don't appear to be.

GCC and other projects are sufficiently high targets that we should not trust the infrastructure to be secure or admins to be above being bribed or forced under duress.

It looks like the question of who to ultimately trust, either the gatekeeper committer (or two) who is the only person to have write access to the repository, or the admin who manages the box. The gatekeeper committer could also fabricate commits and push to the central repository in the same way. In fact, the gatekeeper committer could choose to do worse, like delaying (or declining to merge) someones patches.

Signed commits would be nice, but we're not there yet as a community.

Quoted 9 lines

From the git backend perspective, this is not optimal, because the resulting
packs contain extra objects that aren't interesting to most cloners. For example, if I only leave refs/heads and refs/tags in the gcc repository, I get rid of over 1.1 million extra objects (from 3.9 million to 2.8 million) and the pack shrinks from 1.8GB to 1.1GB.

To me, it makes more sense to separate this into multiple repositories and relegate vendor/user branches to their own trees. They still share objects behind the scenes, but packs and cloning is much more optimized.

That would be a nice optimization. In fact, an interesting workflow hack here could be to have separate per-maintainer repositories that a central repository pulls from, subject to some checks passing. It won't solve any of the trust problems since the repositories will all be in the same infrastructure, but it will add more validation in the pipeline, while reducing the main repository size.

Thanks,
Sid

#14 lore raw
Quoted 7 lines · Siddhesh Poyarekar
Quoted 4 lines · Konstantin Ryabitsev

[...]
GCC and other projects are sufficiently high targets that we should not trust the infrastructure to be secure or admins to be above being bribed or forced under duress.

It looks like the question of who to ultimately trust, either the gatekeeper committer (or two) who is the only person to have write access to the repository, or the admin who manages the box.  The gatekeeper committer could also fabricate commits and push to the central repository in the same way.  In fact, the gatekeeper committer could choose to do worse, like delaying (or declining to merge) someones patches.

It doesn't seem like an equal comparison - it seems like down one path there is an audit trail by which regular (machine+human) processes can detect malfeasance, while down another path there's a greater opportunity for compromise that can't otherwise be easily checked.

If GNU Toolchain devs haven't developed a full threat model (that would include things like "gatekeeper delaying someone's patches") that would be nice, so that you can weigh approaches that solve some threats but not others, or a combination that maximizes coverage. Social attacks matter - from a security POV it's less "gatekeeper being lazy/a jerk" and more "gatekeeper being compromised by an attacker".

Quoted 1 line

Signed commits would be nice, but we're not there yet as a community.

It's not quite as easy as "hey just add -s to your git commands" but it's not far from that. I'm not a part of the TAC so I won't go further than to suggest that a migration, where there will no doubt have to be some adjustments to process and flow, to introduce other non-zero-effort but non-blocking changes that enhance overall security/integrity.

Brian

Signature · 4 lines
Brian Behlendorf
CTO, Open Source Security Foundation
[email protected]
Twitter: @brianbehlendorf
#15 lore raw
Quoted 3 lines · Brian Behlendorf
Quoted 1 line

Signed commits would be nice, but we're not there yet as a community.

It's not quite as easy as "hey just add -s to your git commands" but it's not far from that. I'm not a part of the TAC so I won't go further than to suggest that a migration, where there will no doubt have to be some adjustments to process and flow, to introduce other non-zero-effort but non-blocking changes that enhance overall security/integrity.

The challenge with cryptographic signing of commits is not a technical one, there are folks who oppose it on an ideological basis. It's probably not that hard to drive consensus in the glibc community for this, but that's still going to be an additional hurdle to cross. I'm not sure if the initial migration is the right time to tackle this.

Likewise for a process change that requires a single trusted gatekeeper.
Even if it has technical merit (I'm still not a 100% convinced), it's
going to be harder to bring in a non-trivial process change like that during the initial migration.

Thanks,
Sid

#16 lore raw
Quoted 18 lines · Siddhesh Poyarekar
Quoted 9 lines · Brian Behlendorf
Quoted 2 lines

Signed commits would be nice, but we're not there yet as a community.

It's not quite as easy as "hey just add -s to your git commands" but it's not far from that. I'm not a part of the TAC so I won't go further than to suggest that a migration, where there will no doubt have to be some adjustments to process and flow, to introduce other non-zero-effort but non-blocking changes that enhance overall security/integrity.

The challenge with cryptographic signing of commits is not a technical one, there are folks who oppose it on an ideological basis. It's probably not that hard to drive consensus in the glibc community for this, but that's still going to be an additional hurdle to cross. I'm not sure if the initial migration is the right time to tackle this.

Quoted 4 lines

Likewise for a process change that requires a single trusted gatekeeper. Even if it has technical merit (I'm still not a 100% convinced), it's going to be harder to bring in a non-trivial process change like that during the initial migration.

Agreed.

We should avoid contentious issues and cleanup only technical debt.

e.g.

* What are all the git hooks we use?
* Which can be moved to webhooks?

* Stop supporting CVS/SVN and export tarball dumps.

* Migrate from moinmoin to readthedocs/sphinx.

Signature · 2 lines
Cheers,
Carlos.
#17 lore raw
In reply to Siddhesh Poyarekar
Quoted 3 lines · Siddhesh Poyarekar

It looks like the question of who to ultimately trust, either the gatekeeper committer (or two) who is the only person to have write access to the repository, or the admin who manages the box.

The maintainer's action are in the public, while the admin's actions are hidden.

Quoted 2 lines

The gatekeeper committer could also fabricate commits and push to the central repository in the same way.

1. Not with nearly as much impunity, especially if non-fast-forward pushes are disallowed.
2. At best, a maintainer can modify someone's patch to introduce a deliberate bug, not freely modify a commit somewhere in recent history to add significant chunks of code like an admin can.
3. If it's someone else's code they are committing, the original developer will probably discover any malicious edits, because they will be watching their own commits show up in the repository.
4. It's much easier to audit and review the actions of 2-3 co-maintainers than when hundreds of people have write access to the repository.
5. When only a small subset of people can push to a repository, maintaining a valid keyring for verifying their cryptographic signatures is much easier than when 400+ people all have write access.

I could go on for quite a while still. My recent talk at the Linux Security Summit was on the subject of how easy it would be to sneak a backdoor into the Linux kernel where I go into many of these considerations (unfortunately, the talk not yet posted on the LF channel).

Quoted 2 lines

In fact, the gatekeeper committer could choose to do worse, like delaying (or declining to merge) someones patches.

The gatekeeper is accountable to the community and can be replaced. The admin's actions may never be discovered or they can be blamed on someone else.

-K

#18 lore raw
Quoted 3 lines · Konstantin Ryabitsev

2. At best, a maintainer can modify someone's patch to introduce a deliberate bug, not freely modify a commit somewhere in recent history to add significant chunks of code like an admin can.

Modifying an already-visible commit will be very obvious when anyone who has the original commit tries to pull, given that there should never be non-fast-forward pushes (to master, release branches or shared development branches) so people pulling (without local changes on the branch being pulled to) expect a fast-forward update.

Signature · 2 lines
Joseph S. Myers
[email protected]
#19 lore raw
In reply to Konstantin Ryabitsev
Quoted 5 lines · Konstantin Ryabitsev
Quoted 3 lines · Siddhesh Poyarekar

It looks like the question of who to ultimately trust, either the gatekeeper committer (or two) who is the only person to have write access to the repository, or the admin who manages the box.

Quoted 8 lines

The maintainer's action are in the public, while the admin's actions are hidden.

Quoted 2 lines

The gatekeeper committer could also fabricate commits and push to the central repository in the same way.

1. Not with nearly as much impunity, especially if non-fast-forward pushes are disallowed.

If an admin makes a change that needs a fast-forward, anybody trying to sync their repos would see the forced update. I'll admit though that it's arguable how many would actually notice the message.

Thanks,
Sid

#20 lore raw
Quoted 12 lines · Siddhesh Poyarekar
Quoted 11 lines · Konstantin Ryabitsev
Quoted 3 lines · Siddhesh Poyarekar

It looks like the question of who to ultimately trust, either the gatekeeper committer (or two) who is the only person to have write access to the repository, or the admin who manages the box.

The maintainer's action are in the public, while the admin's actions are hidden.

Quoted 2 lines

The gatekeeper committer could also fabricate commits and push to the central repository in the same way.

Quoted 6 lines
Quoted 2 lines

1. Not with nearly as much impunity, especially if non-fast-forward pushes are disallowed.

If an admin makes a change that needs a fast-forward, anybody trying to sync their repos would see the forced update. I'll admit though that it's arguable how many would actually notice the message.

Right. Some of us would, and review the situation.

Let me be clear though, Google *accidentally* force pushed on glibc master branch on 2023-01-10 and the hooks didn't stop them, and it is a known bug in our hooks.

Joseph noticed and called it out... I didn't notice. Nobody else noticed because it was the most recent thing in HEAD and nobody had pulled yet.

Signature · 2 lines
Cheers,
Carlos.
#21 lore raw
In reply to Konstantin Ryabitsev
Quoted 2 lines · Konstantin Ryabitsev

This workflow has one important problem -- you must ultimately trust the integrity of your infrastructure. It would be very easy for a malicious actor

Hence the importance of limiting access to infrastructure - and limiting what pieces of infrastructure have access to what others (rather than the present arrangements where many different services run on the single system with the master repository and with permissions allowing to write to it).

Quoted 2 lines

1. they can override any server-side validations
2. they can disable email notifications

A commit entering the repository without appearing on the mailing list is itself suspect. (It can happen, but it's very rare; maybe about once a year for GCC. The only cause I know of is a bug in the commit email generation that makes it fall over when the diffs are not valid UTF-8.) In the GCC case the commit emails include sequential numbers since the last release branched off; the motivation of those numbers isn't to make missing emails easy to spot (rather, they help with Jakub's system for speeding up bisection by having a large number of prebuilt compilers from different past revisions), but they do make missing emails easy to spot as a side effect.

Quoted 2 lines

This situation could be partially mitigated if commits were cryptographically signed, but they don't appear to be.

It's quite possible commit signatures would be a useful thing to introduce in future.

Quoted 11 lines
Quoted 5 lines

Anyone with commit access can create their own branches in their refs/users/ namespace if they wish, and use them without needing review for commits going there. Shared development branches under refs/heads/devel/ have whatever rules are established by the people setting up those branches.

From the git backend perspective, this is not optimal, because the resulting packs contain extra objects that aren't interesting to most cloners. For example, if I only leave refs/heads and refs/tags in the gcc repository, I get rid of over 1.1 million extra objects (from 3.9 million to 2.8 million) and the pack shrinks from 1.8GB to 1.1GB.

See what I said in the GCC service analysis about use of delta islands to make this efficient. The configuration there is:

[pack]
island = refs/heads/
island = refs/tags/
island = refs/(vendors/[^/]+)/
island = refs/(users/[^/]+)/
island = refs/(git-(svn-)?old)/
island = refs/(dead)/
island = refs/(deleted)/
island = refs/(meta)/

(I don't think the other projects do anything this complicated with refs that aren't fetched by default, only GCC.)

Signature · 2 lines
Joseph S. Myers
[email protected]
#22 lore raw
In reply to Konstantin Ryabitsev
Quoted 11 lines · Konstantin Ryabitsev
Quoted 5 lines
Quoted 3 lines

If you insist, though I still think this is the case of "everyone assumes that someone else is paying attention to it." I am highly critical of setups that fire messages into the ether in hopes that someone checks them.

People do in practice monitor the commit emails.

Okay, if you insist -- after all, we do the same thing for all kernel commits. I just find it a pretty terrible waste of resources, as I'm pretty sure 99% of everyone who subscribes to that list has set things up to go to a folder that they never check.

There's probably a viable middle ground here for glibc, where commits that don't have an entry in patchwork get sent to the list. Given the current traffic for libc-alpha, it won't add much overhead to libc-alpha and also meet auditing requirements.

For the release/* branches, it probably makes more sense to send the commits to libc-stable, thus removing the need for developers to send [committed X.Y] to the list. This should then limit the utility of glibc-cvs to private branch pushes. I doubt if anybody cares about pushes to private branches, do they?

Thanks,
Sid

#23 lore raw
Quoted 4 lines · Siddhesh Poyarekar

There's probably a viable middle ground here for glibc, where commits that don't have an entry in patchwork get sent to the list. Given the current traffic for libc-alpha, it won't add much overhead to libc-alpha and also meet auditing requirements.

I think this is overly complicating things. (Though it would be good for glibc to have the check done for GCC that once a commit is in the repository, emails aren't sent out again for a merge of that commit into a user / vendor / development branch.)

Quoted 5 lines

For the release/* branches, it probably makes more sense to send the commits to libc-stable, thus removing the need for developers to send [committed X.Y] to the list. This should then limit the utility of glibc-cvs to private branch pushes. I doubt if anybody cares about pushes to private branches, do they?

I think commits to user / vendor branches can be of interest. They may suggest things that would be worth adding to master (even if the original author didn't think of them as appropriate for master, or loses interest in them), for example.

Signature · 2 lines
Joseph S. Myers
[email protected]
#24 lore raw
Quoted 18 lines · Joseph Myers
Quoted 4 lines · Siddhesh Poyarekar

There's probably a viable middle ground here for glibc, where commits that don't have an entry in patchwork get sent to the list. Given the current traffic for libc-alpha, it won't add much overhead to libc-alpha and also meet auditing requirements.

I think this is overly complicating things. (Though it would be good for glibc to have the check done for GCC that once a commit is in the repository, emails aren't sent out again for a merge of that commit into a user / vendor / development branch.)

Quoted 5 lines

For the release/* branches, it probably makes more sense to send the commits to libc-stable, thus removing the need for developers to send [committed X.Y] to the list. This should then limit the utility of glibc-cvs to private branch pushes. I doubt if anybody cares about pushes to private branches, do they?

Quoted 4 lines

I think commits to user / vendor branches can be of interest. They may suggest things that would be worth adding to master (even if the original author didn't think of them as appropriate for master, or loses interest in them), for example.

And in fact this is how I track Google's public work on the GRTE glibc branches.

Signature · 2 lines
Cheers,
Carlos.
#25 lore raw
In reply to Joseph Myers
Quoted 5 lines · Joseph Myers

A server can't ensure that the user's clone has any particular custom configuration. We have some optional configuration (gcc-git-customization.sh), but there's no requirement to use it. Checking on push is much more reliable than expecting custom configuration on the user's side.

Is this a case where we are looking to solve a community enforcement issue with a technical solution?

If we removed all the hooks, what is the consequence of a commit that is wrong? Can we just fix the sources with a subsequent commit? Add a light-weight linting check in 'make check' that additionally reports this?

Signature · 2 lines
Cheers,
Carlos.
#26 lore raw
Quoted 4 lines · Carlos O'Donell

If we removed all the hooks, what is the consequence of a commit that is wrong? Can we just fix the sources with a subsequent commit? Add a light-weight linting check in 'make check' that additionally reports this?

The consequence, at least for GCC, is that other scripting that depends on certain invariants of commits falls over. Mapping from SVN revisions to git commits relies on only a single commit matching a given From-SVN commit message pattern rather than such a commit message getting quoted in another commit message in a way that confuses the mapping. ChangeLog generation falls over if there are various problems with commit contents or messages.

Signature · 2 lines
Joseph S. Myers
[email protected]
#27 lore raw
Quoted 7 lines · Joseph Myers
Quoted 4 lines · Carlos O'Donell

If we removed all the hooks, what is the consequence of a commit that is wrong? Can we just fix the sources with a subsequent commit? Add a light-weight linting check in 'make check' that additionally reports this?

Quoted 7 lines

The consequence, at least for GCC, is that other scripting that depends on certain invariants of commits falls over. Mapping from SVN revisions to git commits relies on only a single commit matching a given From-SVN commit message pattern rather than such a commit message getting quoted in another commit message in a way that confuses the mapping. ChangeLog generation falls over if there are various problems with commit contents or messages.

Thanks, both of those seem like they are surmountable challenges:

(a) The community may choose not to support SVN/CVS legacy repositories.

(b) You already need a ChangeLog post-process to fix issues, so the hook is a belt-and-suspenders way to reduce the work done by global maintainers to keep the ChangeLog clean.

Just a reminder that we are talking about the cost of the glibc migration, but have also started discussing the gcc migration which is more complex.

(1) CVS/SVN read-only repositories.

If the GCC community decides not to keep the read-only CVS and SVN repositories in favour of the git repository with all the currently converted history, then does this remove some of the more complex git hooks?

(2) Changelog invariant checking.

ChangeLog generation as I understand it is a concatenation of the commit message ChangeLog snippet (Nightly update_version_git), and already would need manual editing if someone makes a mistake e.g. 32582c190b91287a0d1239162333f5ad0ac81e72 in gcc where Jakub adjusts the entries? Does dropping this hook create more work for you and Jakub and Richie to udpate malformed ChangeLog entries for the day? Who gets email if the update fails?

Signature · 2 lines
Cheers,
Carlos.
#28 lore raw
Quoted 6 lines · Carlos O'Donell

(1) CVS/SVN read-only repositories.

If the GCC community decides not to keep the read-only CVS and SVN repositories in favour of the git repository with all the currently converted history, then does this remove some of the more complex git hooks?

No. The point of logic that looks for From-SVN: (and thus requires no new commits to have a line in the commit message starting From-SVN:) is precisely to convert from an SVN commit reference in e.g. an old email or bug report to a corresponding git commit, *without* referring to the read-only SVN repository. I'm expecting the read-only repository to be made available as a downloadable tarball/dump rather than continuing to be served with the SVN protocol.

Quoted 9 lines

(2) Changelog invariant checking.

ChangeLog generation as I understand it is a concatenation of the commit message ChangeLog snippet (Nightly update_version_git), and already would need manual editing if someone makes a mistake e.g. 32582c190b91287a0d1239162333f5ad0ac81e72 in gcc where Jakub adjusts the entries? Does dropping this hook create more work for you and Jakub and Richie to udpate malformed ChangeLog entries for the day? Who gets email if the update fails?

Manual work is rarely needed, generally only if there is a bug in the hook that means the hook fails to reject a commit but the nightly ChangeLog generation falls over (see the total of seven commits listed in git_update_version.py:IGNORED_COMMITS that resulted in such issues). Almost all the time when someone makes a mistake in the commit message formatting that would affect that nightly generation, it's caught by the hook and never gets into the repository.

Signature · 2 lines
Joseph S. Myers
[email protected]