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

Bug: contribution guidelines contradict git guidelines #119

Open
AlexanderLanin opened this issue Dec 17, 2024 · 6 comments · May be fixed by #137
Open

Bug: contribution guidelines contradict git guidelines #119

AlexanderLanin opened this issue Dec 17, 2024 · 6 comments · May be fixed by #137

Comments

@AlexanderLanin
Copy link

AlexanderLanin commented Dec 17, 2024

Current state

Contribution Request Guideline states For simple contributions, like fixing bugs or improvements, just creating a PR is sufficient.

Git Guidelines state that Issue-ref: <Keyword> #<IssueNr> is a mandatory part of commit messages.

Implementation mandates the Git Guidelines wording.

Issue

When creating a simple pull request, there is no issue which could be referenced. We already agreed to not have a default issue in such cases, since we wanted to follow common practices on GitHub.

Referencing the pull request itself is also impossible, since the commit is created before the pull request.

Alternatives

@ltekieli
Copy link
Member

ltekieli commented Dec 17, 2024

I meant add a commit title prefix like "fixup:" or "(chore)", that will skip checking the issue-ref completely. Eg.:

[ignore-by-title]
# Match commit titles starting with "(chore)"
regex=^\(chore\)(.*)
ignore=body-match-regex

@AlexanderLanin
Copy link
Author

Ah, that makes more sense :-)

But I have a little issue with the commit title anyway: #88 (comment)

@ltekieli
Copy link
Member

ltekieli commented Dec 17, 2024

But I have a little issue with the commit title anyway: #88 (comment)

Similar to the previous internal setup, we should have the squash option disabled, and rely on the users being able to correctly structure a PR with proper commits.

@AlexanderLanin
Copy link
Author

While I agree, that makes reviews difficult as we loose the "show diff since last review" option.

@LittleHuba
Copy link
Contributor

Referencing the pull request itself is also impossible, since the commit is created before the pull request.

Github adds that reference in its frontend automatically. Hence, there is no need to put it manually. If there is an issue that a PR fixes, then the PR shall link to that issue.

I strongly favor just removing Issue-ref completely. There is no benefit in forcing users to manually put a number there, where we can not check that the right number was put.
If somebody really wants to highlight the relationship, he still can, but making it mandatory is no benefit.

@pahmann
Copy link
Contributor

pahmann commented Dec 17, 2024

I agree that Issue-Refs are nothing which is typically used in GitHub. On the other side, nobody can point me to a project argumenting ISO 26262 compliance.

Beside that we can see that ThreadX e.g. with https://github.com/eclipse-threadx/threadx/pull/159/files does not use any reference in their PRs, but have a manual version history in their files.
Another thing observed is SpaceROS which have a check that Issues are properly referred. They have this integrated to comply with the NASA development process. See e.g. space-ros/space-ros#186

What we have to consider is, that we will not enforce every OSS project we consume to use Issue-Refs: So what about unused code. Also, they may reject our patches to upstream, in case we include Issue-Refs. in there. We would need to maintain two versions of patch and cannot go upstream properly in case we do a fix.

LittleHuba added a commit that referenced this issue Dec 20, 2024
Commits are linked by Github to the PR that introduced them.
It is impossible to merge a commit without PR.
Hence, it is sufficient if the PR links to issues.

We have no tooling that would verify that the linkage of a
commit is correct. Thus, making an issue reference in the
commit message mandatory holds no benefit.

It is still allowed to reference an issue in a commit
message. It is simply no longer mandatory.

Issue-ref: closes #131
Issue-ref: closes #119
@LittleHuba LittleHuba linked a pull request Dec 20, 2024 that will close this issue
LittleHuba added a commit that referenced this issue Dec 20, 2024
Commits are linked by Github to the PR that introduced them.
It is impossible to merge a commit without PR.
Hence, it is sufficient if the PR links to issues.

We have no tooling that would verify that the linkage of a
commit is correct. Thus, making an issue reference in the
commit message mandatory holds no benefit.

It is still allowed to reference an issue in a commit
message. It is simply no longer mandatory.

Issue-ref: closes #131
Issue-ref: closes #119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants