Skip to content

Commit

Permalink
Merge branch 'main' into v0.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
krancour authored Nov 16, 2023
2 parents 1719cff + db3a968 commit d59e2d6
Show file tree
Hide file tree
Showing 25 changed files with 1,308 additions and 1,132 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
test-unit:
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -33,7 +33,7 @@ jobs:
lint-go:
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -54,7 +54,7 @@ jobs:
lint-charts:
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -69,7 +69,7 @@ jobs:
lint-proto:
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -85,7 +85,7 @@ jobs:
check-codegen:
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
needs: [test-unit, lint-go, lint-charts, lint-proto, check-codegen]
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
if: github.event_name == 'release'
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
strategy:
matrix:
os: [linux, darwin, windows]
Expand Down Expand Up @@ -208,8 +208,11 @@ jobs:
if: github.event_name != 'release'
runs-on: ubuntu-latest
container:
image: golang:1.21.3-bookworm
image: golang:1.21.4-bookworm
steps:
- name: Install awscli
run: |
apt update && apt install awscli -y
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
####################################################################################################
# builder
####################################################################################################
FROM --platform=$BUILDPLATFORM golang:1.21.3-bookworm as builder
FROM --platform=$BUILDPLATFORM golang:1.21.4-bookworm as builder

ARG TARGETOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.3-bookworm
FROM golang:1.21.4-bookworm

ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion charts/kargo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In the average case, these settings should be left alone.
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
| `api.enabled` | Whether the API server is enabled. | `true` |
| `api.replicas` | The number of API server pods. | `1` |
| `api.host` | The domain name where Kargo's API server will be accessible. This is used for (when applicable) generation of an Ingress resource, certificates, and the OpenID Connect issuer and callback URLs. Note: The protocol (http vs https) should not be specified and is automatically inferred from other configuration options. | `localhost` |
| `api.host` | The domain name where Kargo's API server will be accessible. When applicable, this is used for generation of an Ingress resource, certificates, and the OpenID Connect issuer and callback URLs. Note: The value in this field MAY include a port number and MUST NOT specify the protocol (http vs https), which is automatically inferred from other configuration options. | `localhost` |
| `api.logLevel` | The log level for the API server. | `INFO` |
| `api.resources` | Resources limits and requests for the api containers. | `{}` |
| `api.nodeSelector` | Node selector for api pods. | `{}` |
Expand Down
2 changes: 1 addition & 1 deletion charts/kargo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ api:
enabled: true
## @param api.replicas The number of API server pods.
replicas: 1
## @param api.host The domain name where Kargo's API server will be accessible. This is used for (when applicable) generation of an Ingress resource, certificates, and the OpenID Connect issuer and callback URLs. Note: The protocol (http vs https) should not be specified and is automatically inferred from other configuration options.
## @param api.host The domain name where Kargo's API server will be accessible. When applicable, this is used for generation of an Ingress resource, certificates, and the OpenID Connect issuer and callback URLs. Note: The value in this field MAY include a port number and MUST NOT specify the protocol (http vs https), which is automatically inferred from other configuration options.
host: localhost
## @param api.logLevel The log level for the API server.
logLevel: INFO
Expand Down
38 changes: 34 additions & 4 deletions internal/controller/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ type repo struct {
currentBranch string
}

// CloneOptions represents options for cloning a git repository.
type CloneOptions struct {
// Branch is the name of the branch to clone. If not specified, the default
// branch will be cloned.
Branch string
// SingleBranch indicates whether the clone should be a single-branch clone.
SingleBranch bool
// Shallow indicates whether the clone should be with a depth of 1. This is
// useful for speeding up the cloning process when all we care about is the
// latest commit from a single branch.
Shallow bool
}

// Clone produces a local clone of the remote git repository at the specified
// URL and returns an implementation of the Repo interface that is stateful and
// NOT suitable for use across multiple goroutines. This function will also
Expand All @@ -103,6 +116,7 @@ type repo struct {
func Clone(
repoURL string,
repoCreds RepoCredentials,
opts *CloneOptions,
) (Repo, error) {
homeDir, err := os.MkdirTemp("", "")
if err != nil {
Expand All @@ -120,7 +134,7 @@ func Clone(
if err = r.setupAuth(repoCreds); err != nil {
return nil, err
}
return r, r.clone()
return r, r.clone(opts)
}

func (r *repo) AddAll() error {
Expand All @@ -140,9 +154,25 @@ func (r *repo) Clean() error {
return errors.Wrapf(err, "error cleaning branch %q", r.currentBranch)
}

func (r *repo) clone() error {
r.currentBranch = "HEAD"
cmd := r.buildCommand("clone", "--no-tags", r.url, r.dir)
func (r *repo) clone(opts *CloneOptions) error {
if opts == nil {
opts = &CloneOptions{}
}
args := []string{"clone", "--no-tags"}
if opts.Branch != "" {
args = append(args, "--branch", opts.Branch)
r.currentBranch = opts.Branch
} else {
r.currentBranch = "HEAD"
}
if opts.SingleBranch {
args = append(args, "--single-branch")
}
if opts.Shallow {
args = append(args, "--depth=1")
}
args = append(args, r.url, r.dir)
cmd := r.buildCommand(args...)
cmd.Dir = r.homeDir // Override the cmd.Dir that's set by r.buildCommand()
_, err := libExec.Exec(cmd)
return errors.Wrapf(
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/promotion/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (g *gitMechanism) gitCommit(
if creds == nil {
creds = &git.RepoCredentials{}
}
repo, err := git.Clone(update.RepoURL, *creds)
repo, err := git.Clone(update.RepoURL, *creds, nil)
if err != nil {
return "", errors.Wrapf(err, "error cloning git repo %q", update.RepoURL)
}
Expand Down
20 changes: 9 additions & 11 deletions internal/controller/warehouses/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,17 @@ func getLatestCommitMeta(
if creds == nil {
creds = &git.RepoCredentials{}
}
repo, err := git.Clone(repoURL, *creds)
repo, err := git.Clone(
repoURL,
*creds,
&git.CloneOptions{
Branch: branch,
SingleBranch: true,
Shallow: true,
},
)
if err != nil {
return nil, errors.Wrapf(err, "error cloning git repo %q", repoURL)

}
if branch != "" {
if err = repo.Checkout(branch); err != nil {
return nil, errors.Wrapf(
err,
"error checking out branch %q from git repo",
repoURL,
)
}
}
var gm gitMeta
gm.Commit, err = repo.LastCommitID()
Expand Down
11 changes: 0 additions & 11 deletions internal/controller/warehouses/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,6 @@ func TestGetLatestCommitID(t *testing.T) {
require.Contains(t, err.Error(), "error cloning git repo")
},
},

{
name: "error checking out branch",
repoURL: "https://github.com/akuity/kargo.git",
branch: "bogus", // This should force a failure
assertions: func(_ *gitMeta, err error) {
require.Error(t, err)
require.Contains(t, err.Error(), "error checking out branch")
},
},

{
name: "success",
repoURL: "https://github.com/akuity/kargo.git",
Expand Down
66 changes: 33 additions & 33 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,59 @@
"license": "ISC",
"devDependencies": {
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
"@types/json-schema": "^7.0.12",
"@types/node": "^18.16.1",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1",
"@vitejs/plugin-react": "^4.1.0",
"autoprefixer": "^10.4.14",
"@types/json-schema": "^7.0.15",
"@types/node": "^20.9.0",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@vitejs/plugin-react": "^4.1.1",
"autoprefixer": "^10.4.16",
"cssnano": "^6.0.1",
"eslint": "^8.51.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-refresh": "^0.4.3",
"json-stable-stringify": "^1.0.2",
"eslint-plugin-react-refresh": "^0.4.4",
"json-stable-stringify": "^1.1.0",
"less": "^4.2.0",
"postcss": "^8.4.23",
"prettier": "^2.8.8",
"tailwindcss": "^3.3.2",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"tailwindcss": "^3.3.5",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vite-tsconfig-paths": "^4.2.0",
"vite": "^4.5.0",
"vite-tsconfig-paths": "^4.2.1",
"zx": "^7.2.3"
},
"packageManager": "[email protected]",
"dependencies": {
"@bufbuild/connect": "0.13.0",
"@bufbuild/connect-query": "0.4.1",
"@bufbuild/connect-web": "^0.13.0",
"@bufbuild/protobuf": "1.3.3",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@bufbuild/protobuf": "1.4.2",
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-brands-svg-icons": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@hookform/resolvers": "^3.3.1",
"@monaco-editor/react": "^4.5.1",
"@tanstack/react-query": "^4.36.1",
"@types/dagre": "^0.7.49",
"antd": "^5.9.4",
"@hookform/resolvers": "^3.3.2",
"@monaco-editor/react": "^4.6.0",
"@tanstack/react-query": "^5.8.4",
"@types/dagre": "^0.7.52",
"antd": "^5.11.1",
"classnames": "^2.3.2",
"dagre": "^0.8.5",
"date-fns": "^2.30.0",
"monaco-editor": "^0.44.0",
"monaco-yaml": "^4.0.4",
"oauth4webapi": "^2.3.0",
"monaco-yaml": "^5.1.0",
"oauth4webapi": "^2.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.47.0",
"react-router-dom": "^6.16.0",
"react-hook-form": "^7.48.2",
"react-router-dom": "^6.18.0",
"vite-plugin-monaco-editor": "^1.1.0",
"vitest": "^0.34.6",
"yaml": "^2.3.1",
"yaml": "^2.3.4",
"zod": "^3.22.4"
}
}
Loading

0 comments on commit d59e2d6

Please sign in to comment.