.cr-index folder must be manually created
- Dominant language
- Go
- Stars
- 783
- Forks
- 126
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 11
Description
Hello!
Maybe I'm doing something wrong here, but I needed to manually create the `.cr-index` folder for the `cr index` command to work.
This is what I did:
```console
$ docker run --rm --entrypoint=sh -it -v $PWD:/app quay.io/helmpack/chart-releaser:v1.4.0
/app # cr package chart
Successfully packaged chart in /app/chart and saved it to: .cr-release-packages/gatekeeper-policy-manager-0.2.0.tgz
/app # cr index --owner sighupio --git-repo gatekeeper-policy-manager
Loading index file from git repository .cr-index/index.yaml
Preparing worktree (detached HEAD e1f5fee)
HEAD is now at e1f5fee Clean branch for Helm Chart Repository with GitHub Pages
Found gatekeeper-policy-manager-0.2.0.tgz
Extracting chart metadata from .cr-release-packages/gatekeeper-policy-manager-0.2.0.tgz
Calculating Hash for .cr-release-packages/gatekeeper-policy-manager-0.2.0.tgz
Updating index .cr-index/index.yaml
Error: open .cr-index/index.yaml3862730865: no such file or directory
Usage:
cr index [flags]
Flags:
-b, --git-base-url string GitHub Base URL (only needed for private GitHub) (default "https://api.github.com/")
-r, --git-repo string GitHub repository
-u, --git-upload-url string GitHub Upload URL (only needed for private GitHub) (default "https://uploads.github.com/")
-h, --help help for index
-i, --index-path string Path to index file (default ".cr-index/index.yaml")
-o, --owner string GitHub username or organization
-p, --package-path string Path to directory with chart packages (default ".cr-release-packages")
--pages-branch string The GitHub pages branch (default "gh-pages")
--pages-index-path string The GitHub pages index path (default "index.yaml")
--pr Create a pull request for index.yaml against the GitHub Pages branch (must not be set if --push is set)
--push Push index.yaml to the GitHub Pages branch (must not be set if --pr is set)
--release-name-template string Go template for computing release names, using chart metadata (default "{{ .Name }}-{{ .Version }}")
--remote string The Git remote used when creating a local worktree for the GitHub Pages branch (default "origin")
-t, --token string GitHub Auth Token (only needed for private repos)
Global Flags:
--config string Config file (default is $HOME/.cr.yaml)
/app # cat .cr-index/index.yaml
cat: can't open '.cr-index/index.yaml': No such file or directory
/app # mkdir .cr-index
/app # cr index --owner sighupio --git-repo gatekeeper-policy-manager
Loading index file from git repository .cr-index/index.yaml
Preparing worktree (detached HEAD e1f5fee)
HEAD is now at e1f5fee Clean branch for Helm Chart Repository with GitHub Pages
Found gatekeeper-policy-manager-0.2.0.tgz
Extracting chart metadata from .cr-release-packages/gatekeeper-policy-manager-0.2.0.tgz
Calculating Hash for .cr-release-packages/gatekeeper-policy-manager-0.2.0.tgz
Updating index .cr-index/index.yaml
/app # cat .cr-index/index.yaml
apiVersion: v1
entries:
gatekeeper-policy-manager:
[...] # truncated output
```
EDIT: I got the same behaviour in CI and locally.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with `cr index --owner sighupio --git-repo gatekeeper-policy-manager` in a checkout without `.cr-index`, then repeat after creating the directory. Trace the `cr index` entry point and its default `.cr-index/index.yaml` handling; done means indexing succeeds without manually creating the directory, with coverage for the missing-directory case if the project has relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100