Skip to content

Migrate to go modules#5069

Closed
coolaj86 wants to merge 5 commits into
go-gitea:masterfrom
coolaj86:go-modules
Closed

Migrate to go modules#5069
coolaj86 wants to merge 5 commits into
go-gitea:masterfrom
coolaj86:go-modules

Conversation

@coolaj86

Copy link
Copy Markdown
Contributor

Re: #5044

  • remove a few unused modules (bolt, gorilla)
  • go mod init and go mod tidy (adds go.mod and go.sum)
  • remove Gopkg.*
  • update drone file? (doesn't look like there was much to do)

@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Oct 11, 2018
Comment thread .gitignore
@@ -1,3 +1,5 @@
vendor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMHO we shouldn't remove the vendor dir.
If a dependency or its host goes down, we can't build Gitea anymore.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 11, 2018
@jonasfranz

Copy link
Copy Markdown
Member

Please update the makefile in order to make sure that our CI tasks are going to work.

Comment thread Makefile
unit-test-coverage:
for PKG in $(PACKAGES); do $(GO) test -tags=sqlite -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;

.PHONY: vendor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't remove the vendor and test-vendor tasks.

Comment thread cmd/web.go
"code.gitea.io/gitea/routers/routes"

"github.com/Unknwon/com"
context2 "github.com/gorilla/context"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@lunny

lunny commented Oct 11, 2018

Copy link
Copy Markdown
Member

Since Gitea depends on so many Go libraries. I would like to keep vendor to use go mod vendor.

@appleboy

Copy link
Copy Markdown
Member

@coolaj86 Add build test in Drone

  build-with-go-module:
    image: golang:1.11
    pull: true
    environment:
      - TAGS="bindata sqlite"
      - GO111MODULE=on
    commands:
      - make clean
      - make generate
      - make build
    when:
      event: [ push, tag, pull_request ]

@xor-gate

Copy link
Copy Markdown
Contributor

As @lunny suggests indeed it is good to cache also in the vendor folder. Because when somebody decides to pull the plug out of a dependency you are screwed.

Comment thread .drone.yml
event: [ push, tag, pull_request ]

build-without-gcc:
image: golang:1.9

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you keep this pegged at 1.9 as it is currently the oldest version of go that is supported.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(but the others can remain at 1.11 as we just need to ensure that 1.9 builds, but we will distribute the versions of gitea that are built with a more recent version)

@stale

stale Bot commented Jan 4, 2019

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale Bot added the issue/stale label Jan 4, 2019
@typeless typeless mentioned this pull request Jan 16, 2019
@techknowlogick

Copy link
Copy Markdown
Member

Closing due to #5743

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
project-mirrors-bot-tu Bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this pull request Jan 30, 2025
…go-gitea#6525)

### Screenshot
#### Before
See go-gitea#5069.
#### After
![image](/attachments/d57c2ff8-d29e-41b8-9280-c884ac43f12e)
### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).
- Manual testing: see https://codeberg.org/forgejo/forgejo/pulls/6525#issuecomment-2578814. Thanks @earl-warren.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6525
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
project-mirrors-bot-tu Bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this pull request Jan 30, 2025
…go-gitea#6525)

### Screenshot
#### Before
See go-gitea#5069.
#### After
![image](/attachments/d57c2ff8-d29e-41b8-9280-c884ac43f12e)
### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).
- Manual testing: see https://codeberg.org/forgejo/forgejo/pulls/6525#issuecomment-2578814. Thanks @earl-warren.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6525
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
(cherry picked from commit c0a2108)
project-mirrors-bot-tu Bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this pull request Jan 30, 2025
go-gitea#5069 (go-gitea#6739)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/6525

### Screenshot
#### Before
See go-gitea#5069.
#### After
![image](/attachments/d57c2ff8-d29e-41b8-9280-c884ac43f12e)
### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).
- Manual testing: see https://codeberg.org/forgejo/forgejo/pulls/6525#issuecomment-2578814. Thanks @earl-warren.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Co-authored-by: Robert Wolff <mahlzahn@posteo.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6739
Reviewed-by: Robert Wolff <mahlzahn@posteo.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

issue/stale lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants