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

go.work example #4117

Draft
wants to merge 3 commits into
base: branch-3.4
Choose a base branch
from
Draft

go.work example #4117

wants to merge 3 commits into from

Conversation

karol-kokoszka
Copy link
Collaborator

@karol-kokoszka karol-kokoszka commented Nov 19, 2024

Example for go.work making it working differently depending on ENV var.

There should be GITHUB_ACTIONS env var determining if the build is done on GH.

It's branched out from branch-3.4, that's why the PR wants to merge to branch-3.4.

I'm not gonna merge that PR. It's just an example.

Now:

➜  scylla-manager git:(gowork-playground) ✗ make run-server
==> Building scylla-manager with ENV=prod
# github.com/scylladb/scylla-manager/v3/pkg/cmd/scylla-manager
pkg/cmd/scylla-manager/main.go:14:7: undefined: util.Panic
Build failed
make: *** [Makefile:212: build-server] Error 1
➜  scylla-manager git:(gowork-playground) ✗ ENV=local make run-server
==> Building scylla-manager with ENV=local
7af38cf22450da40270d6ffb80f5ec1a0f7ac934772312f4036a89cfa49c0ff4

It still requires to update dependencency when sending PR to GH for a review.
And CI forces you to do that by failing builds (or tests as it will refer to modules from vendor dir).


Please make sure that:

  • Code is split to commits that address a single change
  • Commit messages are informative
  • Commit titles have module prefix
  • Commit titles have issue nr. suffix

ENV=prod (default) builds without go.work
ENV != prod builds with go.work
ENV=prod (default) builds without go.work
ENV != prod builds with go.work
@karol-kokoszka
Copy link
Collaborator Author

Updated to include build target on make check -> Sanity Checks expected to fail

@karol-kokoszka
Copy link
Collaborator Author

We can / should set branch protection rules to disallow merging if one of (Sanity Check) or all GH actions checks fail.

ENV=prod (default) builds without go.work
ENV != prod builds with go.work
@Michal-Leszczynski
Copy link
Collaborator

@karol-kokoszka @VAveryanov8 maybe it would be good to have a meeting and discuss available possibilities with their pros and cons? We should also talk about how we want to handle merging changes from master to release branches, so that we both respect SEMVER and we don't need to browse all commits and cherry pick them every time we want to make a release.

I can schedule a meeting for tomorrow at 12:00 CET if that's fine with you.

@karol-kokoszka karol-kokoszka marked this pull request as draft November 19, 2024 11:39
@karol-kokoszka
Copy link
Collaborator Author

@Michal-Leszczynski ok, let's schedule the meeting

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 this pull request may close these issues.

2 participants