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

update description about vendoring in CONTRIBUTING.md #18280

Merged
merged 13 commits into from
Jan 17, 2022

Conversation

a1012112796
Copy link
Member

follow #18277

TODO:

  • any other things about Remove golang vendored directory ?

follow go-gitea#18277

Signed-off-by: a1012112796 <1012112796@qq.com>
CONTRIBUTING.md Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@7dde39a). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18280   +/-   ##
=======================================
  Coverage        ?   45.75%           
=======================================
  Files           ?      831           
  Lines           ?    92204           
  Branches        ?        0           
=======================================
  Hits            ?    42188           
  Misses          ?    43254           
  Partials        ?     6762           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7dde39a...3f7b3f5. Read the comment docs.

Comment on lines +96 to 97
Pull requests should only include `go.mod`, `go.sum` updates if they are part of
the same change, be it a bugfix or a feature addition.
Copy link
Contributor

Choose a reason for hiding this comment

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

I can not quite understand the purpose of this description. Maybe it can be simplified. The Go Modules document already contains all information.

Copy link
Member Author

Choose a reason for hiding this comment

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

/cc @lunny @techknowlogick

Suggested change
Pull requests should only include `go.mod`, `go.sum` updates if they are part of
the same change, be it a bugfix or a feature addition.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the proposed change is correct and should remain (see below for the rationale).

Copy link
Contributor

Choose a reason for hiding this comment

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

The old text was talking about vendor directory. But now, that is it talking about?

if they are part of the same change: what is the same change ...
be it a bugfix or a feature addition what does the bug fix or feature addition refer to ....

Comment on lines +99 to 101
The `go.mod`, `go.sum` update needs to be justified as part of the PR description,
and must be verified by the reviewers and/or merger to always reference
an existing upstream commit.
Copy link
Contributor

Choose a reason for hiding this comment

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

If we use Go Modules, we do not need to check the upstream commit again. This check was required by the committed vendor directory in my mind.

Copy link
Contributor

Choose a reason for hiding this comment

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

The intent of this paragraph is to require a justification whenever a dependency is added or modified. I think the proposed change is correct. Adding a new dependency previously meant modifying vendor/, go.mod and go.sum. Requiring an explanation when vendor/ was modified implied requiring an explanation when go.mod and go.sum was modified. Now that vendor/ is removed, there is a need to rephrase the requirement.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Comment on lines +99 to 101
The `go.mod`, `go.sum` update needs to be justified as part of the PR description,
and must be verified by the reviewers and/or merger to always reference
an existing upstream commit.
Copy link
Contributor

Choose a reason for hiding this comment

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

The intent of this paragraph is to require a justification whenever a dependency is added or modified. I think the proposed change is correct. Adding a new dependency previously meant modifying vendor/, go.mod and go.sum. Requiring an explanation when vendor/ was modified implied requiring an explanation when go.mod and go.sum was modified. Now that vendor/ is removed, there is a need to rephrase the requirement.

Comment on lines +96 to 97
Pull requests should only include `go.mod`, `go.sum` updates if they are part of
the same change, be it a bugfix or a feature addition.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the proposed change is correct and should remain (see below for the rationale).

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 15, 2022
@singuliere
Copy link
Contributor

singuliere commented Jan 15, 2022

The .gitignore file contains a /vendor line now obsolete. It is not strictly in scope for this PR but since you're looking for elements that became redundant after the removal of the vendor directory, here is one :-)

@singuliere
Copy link
Contributor

singuliere commented Jan 15, 2022

And another one: the test-vendor target in Makefile. And grep -v /vendor/ in Makefile as well.

@silverwind
Copy link
Member

This .gitattributes entry can be removed:

/vendor/** -text -eol linguist-vendored

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 15, 2022
@wxiaoguang wxiaoguang added type/docs This PR mainly updates/creates documentation skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Jan 16, 2022
Makefile Outdated Show resolved Hide resolved
Signed-off-by: a1012112796 <1012112796@qq.com>
@a1012112796
Copy link
Member Author

wonder if build.go still usefull?

gitea/build.go

Lines 1 to 25 in 4d0a72a

// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//go:build vendor
// +build vendor
package main
// Libraries that are included to vendor utilities used during build.
// These libraries will not be included in a normal compilation.
import (
// for embed
_ "github.com/shurcooL/vfsgen"
// for cover merge
_ "golang.org/x/tools/cover"
// for vet
_ "code.gitea.io/gitea-vet"
// for swagger
_ "github.com/go-swagger/go-swagger/cmd/swagger"
)

.gitattributes Outdated Show resolved Hide resolved
@silverwind
Copy link
Member

wonder if build.go still usefull?

I think it's probably obsolete, but this removal can also be done in another PR.

@techknowlogick techknowlogick merged commit 8581e2f into go-gitea:main Jan 17, 2022
@a1012112796 a1012112796 deleted the remove_vendor_doc branch January 18, 2022 01:30
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 19, 2022
* giteaoffical/main:
  Restore propagation of ErrDependenciesLeft (go-gitea#18325)
  Fix PR comments UI (go-gitea#18323)
  Make the height of the editor in Review Box smaller (4 lines as GitHub) (go-gitea#18319)
  Fix commit links on compare page (go-gitea#18310)
  Update JS dependencies, remove eslint-plugin-github (go-gitea#18317)
  Add MirrorUpdated field to Repository API type (go-gitea#18267)
  replace satori/go.uuid with gofrs/uuid (go-gitea#18311)
  Place inline diff comment dialogs in the 4th column. (go-gitea#18321)
  Use indirect comparison when showing pull requests (go-gitea#18313)
  Prevent ambiguous column error in organizations page (go-gitea#18314)
  Correctly upload LFS files (go-gitea#18316)
  [skip ci] Updated translations via Crowdin
  update description about vendoring in CONTRIBUTING.md (go-gitea#18280)
  Fix CheckRepoStats and reuse it during migration (go-gitea#18264)
  Minor tweak to tag list (go-gitea#18295)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* update description about vendoring in CONTRIBUTING.md

follow go-gitea#18277

Signed-off-by: a1012112796 <1012112796@qq.com>

* Update CONTRIBUTING.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>

* fix and readd test-vendor step

* remove vendor from .gitattributes @silverwind

* simplify go mod check

Signed-off-by: a1012112796 <1012112796@qq.com>

* Revert "remove vendor from .gitattributes @silverwind"

This reverts commit 4789e70.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants