Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust submission procedure documentation to get correct PR base repo #3242

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 22, 2023

Background

The goal is to make it possible for any community member to submit libraries to the registry, regardless of their level of relevant technical expertise. For this reason, the project documentation includes a detailed and comprehensive set of instructions for submitting a library.

Since the time these instructions were written, a regression was introduced into the GitHub website:

When creating a commit via the GitHub web interface, the dialog allows the user to select which branch the commit should be made to. Typically this includes two options:

  • "Commit directly to the <target branch> branch"
    (where "<target branch>" is the branch the user had selected when they initiated the procedure)
  • "Create a new branch for this commit and start a pull request"

image

If the branch protection rules configured for the target prevent the user from committing to that branch, then the first of the options is removed (which is the appropriate behavior).

Following the regression, under the conditions produced by the previous submission procedure, the determination of whether the first option should be disabled is based on the branch protection configuration of the arduino/arduino-registry repository, not of the library submitter's fork. This is incorrect because the fork does not inherit the branch protection settings of the parent, meaning the target branch will never be protected in the fork and thus that the commit to that branch should be allowed in the dialog.

Current Behavior

Because we do have branch protection rules enabled for the main branch of the arduino/library-registry repo, this
bug causes the default setting in the dialog to be changed from "Commit directly to the main branch" to "Create a new branch for this commit and start a pull request" when the documented submission procedure is performed:

image

Strangely, the user flow is significantly different depending on which of these options is selected. The user flow when "Create a new branch for this commit and start a pull request" is selected forces the user to submit the PR to their own fork repository instead of to arduino/library-registry (https://github.com/orgs/community/discussions/62973):

image

It is essential for the PR to be submitted to arduino/library-registry so this change in the outcome of the previous documented submission procedure as a side effect of GitHub's regression is catastrophic.

Proposed Change

The submission instructions are here updated to once again produce a correct submission:

image

Unfortunately, the procedure that is now required is more complex and less intuitive than the previous one. In order to mitigate this, I made an effort to be extra explicit both in describing the actions to be performed, as well as describing the expected result of each action.

Additional Context

I reported the regression to GitHub (ticket number 2300326). I will change the documentation back to using the more friendly submission procedure once it is fixed.


I did a survey of the existing forks of this repository in order to identify any intended submissions that were lost due to the contributor following the faulty procedure. I discovered two and facilitated their successful submissions:


Originally reported by @tedtoal at https://forum.arduino.cc/t/problem-trying-to-publish-library/1160232

The goal is to make it possible for any community member to submit libraries to the registry, regardless of their level
of relevant technical expertise. For this reason, the project documentation includes a detailed and comprehensive set of
instructions for submitting a library.

Since the time these instructions were written, a regression was introduced into the GitHub website:

When creating a commit via the GitHub web interface, the dialog allows the user to select which branch the commit should
be made to. Typically this includes two options:

- "Commit directly to the <target branch> branch"
  (where "<target branch>" is the branch the user had selected when they initiated the procedure)
- "Create a new branch for this commit and start a pull request"

If the branch protection rules configured for the target prevent the user from committing to that branch, then the first
of the options is removed (which is the appropriate behavior).

Following GitHub's regression, under the conditions produced by the previous submission procedure, the determination of
whether the first option should be disabled is based on the branch protection configuration of the
arduino/arduino-registry repository, not of the library submitter's fork. This is incorrect because the fork does not
inherit the branch protection settings of the parent, meaning the target branch will never be protected in the fork and
thus that the commit to that branch should be allowed in the dialog.

Because we do have branch protection rules enabled for the `main` branch of the `arduino/library-registry` repo, this
bug causes the default setting in the dialog to be changed from "Commit directly to the main branch" to
"Create a new branch for this commit and start a pull request" when the documented submission procedure is performed.

Strangely, the user flow is significantly different depending on which of these options is selected. The user flow when
"Create a new branch for this commit and start a pull request" is selected forces the user to submit the PR to their own
fork repository instead of to arduino/library-registry. It is essential for the PR to be submitted to
arduino/library-registry so this change in the outcome of the previous documented submission procedure as a side effect
of GitHub's regression is catastrophic.

The submission instructions are hereby updated to once again produce a correct submission. Unfortunately, the procedure
that is now required is more complex and less intuitive than the previous one. In order to mitigate this, I made an
effort to be extra explicit both in describing the actions to be performed, as well as describing the expected result of
each action.

I reported the regression to GitHub. I will change the documentation back to using the more friendly submission
procedure once it is fixed.
@per1234 per1234 added topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project labels Aug 22, 2023
@per1234 per1234 self-assigned this Aug 22, 2023
@github-actions github-actions bot added topic: other Something other than a library list request and removed topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project labels Aug 22, 2023
@github-actions
Copy link
Contributor

Hi @per1234.
Your pull request has been detected as something other than a Library Manager submission.
A maintainer will need to review it before it can be merged.

If you intended to submit a library, please check the instructions and update your pull request if necessary:
https://github.com/arduino/library-registry/blob/main/README.md#instructions

@per1234 per1234 added topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project labels Aug 22, 2023
Copy link
Contributor

@MatteoPologruto MatteoPologruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Per!

@per1234 per1234 merged commit 07ee930 into arduino:main Aug 22, 2023
18 checks passed
@per1234 per1234 deleted the fix-submission-procedure branch August 24, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project topic: other Something other than a library list request type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants