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

Use the nix path for mysql/mariadb 'basedir'. Fixes #2524 #2525

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## Summary

## How was it tested?

## Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
[Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
[Community Contribution License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).
4 changes: 2 additions & 2 deletions .github/workflows/cli-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ jobs:
with:
go-version-file: ./go.mod
- name: Build snapshot with goreleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean --skip-publish --skip-announce --snapshot
args: release --clean --skip=announce,publish --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TELEMETRY_KEY: ${{ secrets.TELEMETRY_KEY }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/cli-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- run: nix build .
- name: Build flake
run: |
if ! nix build .; then
echo "::warning::If this fails, you probably have to run 'devbox run update-hash'"
exit 1
fi
- run: ./result/bin/devbox version

golangci-lint:
Expand Down
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ linters:
disable-all: true
enable:
- dupl
- errorlint
- errcheck
- errorlint
- gofmt
- goimports
- gosimple
Expand All @@ -16,12 +16,12 @@ linters:
- revive
- staticcheck
- stylecheck
- tenv
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- varnamelen
# - wrapcheck If we're going to use github.com/pkg/errors we should probably turn this on?
# We'd like to have the following linter enabled, but it's broken for Go
Expand Down Expand Up @@ -86,7 +86,7 @@ linters-settings:
- w *os.File
wrapcheck:
ignorePackageGlobs:
- go.jetpack.io/devbox/*
- go.jetify.com/devbox/*
misspell:
ignore-words:
- substituters
10 changes: 5 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ builds:
mod_timestamp: "{{ .CommitTimestamp }}" # For reproducible builds
ldflags:
- -s -w
- -X go.jetpack.io/devbox/internal/build.Version={{.Version}}
- -X go.jetpack.io/devbox/internal/build.Commit={{.Commit}}
- -X go.jetpack.io/devbox/internal/build.CommitDate={{.CommitDate}}
- -X go.jetpack.io/devbox/internal/build.SentryDSN={{ .Env.SENTRY_DSN }}
- -X go.jetpack.io/devbox/internal/build.TelemetryKey={{ .Env.TELEMETRY_KEY }}
- -X go.jetify.com/devbox/internal/build.Version={{.Version}}
- -X go.jetify.com/devbox/internal/build.Commit={{.Commit}}
- -X go.jetify.com/devbox/internal/build.CommitDate={{.CommitDate}}
- -X go.jetify.com/devbox/internal/build.SentryDSN={{ .Env.SENTRY_DSN }}
- -X go.jetify.com/devbox/internal/build.TelemetryKey={{ .Env.TELEMETRY_KEY }}
env:
- CGO_ENABLED=0
- GO111MODULE=on
Expand Down
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement. Use the
"Report to repository admins" functionality on GitHub to report.
reported to the community leaders responsible for enforcement. Use the "Report
to repository admins" functionality on GitHub to report.

All complaints will be reviewed and investigated promptly and fairly.

Expand Down
85 changes: 60 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Contributing

When contributing to this repository, please describe the change you wish to make via a related issue, or a pull request.
When contributing to this repository, please describe the change you wish to
make via a related issue, or a pull request.

Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in
all your interactions with the project.

## Setting Up Development Environment

Before making any changes to the source code (documentation excluded) make sure you have installed all the required tools.
Before making any changes to the source code (documentation excluded) make sure
you have installed all the required tools.

### With Devbox

Expand All @@ -21,26 +24,35 @@ The easiest way to develop Devbox is with Devbox!
git clone https://github.com/jetify-com/devbox.git go.jetify.com/devbox
cd go.jetify.com/devbox

3. Build the Devbox CLI. If you don't have Nix installed, Devbox will automatically install it for you before building:
3. Build the Devbox CLI. If you don't have Nix installed, Devbox will
automatically install it for you before building:

devbox run build

4. Start a development shell using your build of Devbox:

dist/devbox shell

Tip: you can also start VSCode from inside your Devbox shell with `devbox run code`.
- If you are encountering an error similar to: `line 3: command 'code' not found`, this means you do not have the Visual Studio Code "Shell Command" installed. To do this, follow the official guide: https://code.visualstudio.com/docs/setup/mac. Please refer to the section under: "Launching from the command line".
Tip: you can also start VSCode from inside your Devbox shell with
`devbox run code`.

- If you encounter an error similar to: `line 3: command 'code' not found`, it
means you do not have the Visual Studio Code "Shell Command" installed. Follow
the official guide at https://code.visualstudio.com/docs/setup/mac. Please
refer to the section under: "Launching from the command line".

### Setting up the Environment Without Devbox

If you are unable to install or use Devbox, you can manually replicate the environment by following the steps below.
If you are unable to install or use Devbox, you can manually replicate the
environment by following the steps below.

1. Install Nix Package Manager. We recommend using the [Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer):
1. Install Nix Package Manager. We recommend using the
[Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer):

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Alternatively, you can also use [the official installer](https://nixos.org/download.html).
Alternatively, you can also use
[the official installer](https://nixos.org/download.html).

2. Install [Go](https://go.dev/doc/install) (current version: 1.20)

Expand All @@ -53,29 +65,52 @@ If you are unable to install or use Devbox, you can manually replicate the envir

## Pull Request Process

1. For new features or non-trivial changes, consider first filing an issue to discuss what changes you plan on making. This will let us help you with implementation details and to make sure we don't duplicate any work.
2. Ensure any new feature or functionality includes tests to verify its correctness.
1. For new features or non-trivial changes, consider first filing an issue to
discuss what changes you intend to make. This will let us help you with
implementation details and to make sure we don't duplicate any work.
2. Ensure any new feature or functionality includes tests to verify its
correctness.
3. Run `devbox run lint` and `devbox run test`.
4. Run `go mod tidy` if you added any new dependencies.
5. Submit your pull request and someone will take a look!

### Style Guide

We don't expect you to read through a long style guide or be an expert in Go before contributing. When necessary, a reviewer will be happy to help out with any suggestions around code style when you submit your PR. Otherwise, the Devbox codebase generally follows common Go idioms and patterns:
We don't expect you to read through a long style guide or be an expert in Go
before contributing. When necessary, a reviewer will be happy to help out with
any suggestions around code style when you submit your PR. Otherwise, the Devbox
codebase generally follows common Go idioms and patterns:

- If you're unfamiliar with idiomatic Go,
[Effective Go](https://go.dev/doc/effective_go) and the
[Google Go Style Guide](https://google.github.io/styleguide/go) are good
resources.
- There's no strict commit message format, but a good practice is to start the
subject with the name of the Go packages you add/modified. For example,
`boxcli: update help for add command`.

## Community Contribution License

Contributions made to this project must be made under the terms of the
[Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).

```
By making a contribution to this project, you certify that:

- If you're unfamiliar with idiomatic Go, [Effective Go](https://go.dev/doc/effective_go) and the [Google Go Style Guide](https://google.github.io/styleguide/go) are good resources.
- There's no strict commit message format, but a good practice is to start the subject with the name of the Go packages you add/modified. For example, `boxcli: update help for add command`.
a. The contribution was created in whole or in part by you and you have the right
to submit it under the Apache 2 License; or

## Developer Certificate of Origin
b. The contribution is based upon previous work that, to the best of your
knowledge, is covered under an appropriate open source license and you have the
right under that license to submit that work with modifications, whether
created in whole or in part by you, under the Apache 2 License; or

By contributing to this project you agree to the [Developer Certificate of Origin](https://developercertificate.org/) (DCO) which was created by the Linux Foundation and is a simple statement that you, as a contributor, have the legal right to make the contribution. See the DCO description for details below:
c. The contribution was provided directly to you by some other person who
certified (a), (b) or (c) and you have not modified it.

> By making a contribution to this project, I certify that:
>
> a. The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
>
> b. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
>
> c. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
>
> d. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
d. You understand and agree that this project and the contribution are public
and that a record of the contribution (including all personal information you
submit with it, including your sign-off) is maintained indefinitely and may be
redistributed consistent with this project or the open source license(s)
involved.
```
Loading