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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add registry commands #798

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

temp
Copy link

@temp temp commented Feb 17, 2022

Hi all 馃憢

Please be gentle - this is my first ever attempt at writing go code ;-)
We have a javascript-based script that can show all kinds of information about the docker-registry inside gitlab. But since I'm a big fan of lab, I tried to integrate it. It's mostly copy&paste, and one new dependency (semver).

The command can list the container registries for the current project, and show tag information (all, latest, detail). One thing is still missing, that is deleting tags, for examples for deleted branches. This is a bit more tricky, but I wanted to collect feedback early.

There is only one test, and I can't seem to get the tests running, I'll update the MR as soon as I know what is failing.

Any feedback is highly appreciated!

@temp
Copy link
Author

temp commented Feb 18, 2022

Still can't run the tests. Can someone give me a hint on what is going wrong? Made sure everything from the README is set.

$ make test
bash -c "trap 'trap - SIGINT SIGTERM ERR; mv testdata/.git testdata/test.git; rm coverage-* 2>&1 > /dev/null; exit 1' SIGINT SIGTERM ERR; /Applications/Xcode.app/Contents/Developer/usr/bin/make internal-test"
rm -f coverage-*
GO111MODULE=on go test -coverprofile=coverage-main.out -covermode=count -coverpkg ./... -run= github.com/zaquestion/lab/cmd github.com/zaquestion/lab/internal/...
2022/02/18 16:55:33 ERROR: root_test.go:162: lstat /Users/swentz/go/src/github.com/zaquestion/lab/testdata-2697813849695773717/test.git: no such file or directory
FAIL	github.com/zaquestion/lab/cmd	3.991s
?   	github.com/zaquestion/lab/internal/action	[no test files]
?   	github.com/zaquestion/lab/internal/browser	[no test files]
ok  	github.com/zaquestion/lab/internal/config	0.632s	coverage: 7.6% of statements in ./...
2022/02/18 16:55:29 ERROR: git_test.go:322: lstat /Users/swentz/go/src/github.com/zaquestion/lab/testdata--4109451602179095731/test.git: no such file or directory
FAIL	github.com/zaquestion/lab/internal/git	0.805s
2022/02/18 16:55:29 ERROR: gitlab_test.go:179: lstat /Users/swentz/go/src/github.com/zaquestion/lab/testdata-6198971420888710828/test.git: no such file or directory
FAIL	github.com/zaquestion/lab/internal/gitlab	0.335s
ok  	github.com/zaquestion/lab/internal/logger	0.954s	coverage: 7.8% of statements in ./...
FAIL
make[1]: *** [internal-test] Error 1
mv: rename testdata/.git to testdata/test.git/.git: No such file or directory
make: *** [test] Error 1

@bmeneg
Copy link
Collaborator

bmeneg commented Feb 21, 2022

Hi @temp !

Thanks for the contribution! And don't worry about your Go-fu level :))
I'll check the feature pretty soon (this week) and give you a feedback.

@dosmanak
Copy link

Still can't run the tests. Can someone give me a hint on what is going wrong? Made sure everything from the README is set.

make[1]: *** [internal-test] Error 1
mv: rename testdata/.git to testdata/test.git/.git: No such file or directory
make: *** [test] Error 1

I had to run mv testdata/test.git/ testdata/.git to get it working. But then I needed gitlab.com account with added ssh key.
The test repo is hardcoded and even with the SSH key I was not able to run tests.

@prarit
Copy link
Collaborator

prarit commented Oct 12, 2022

@dosmanak , the readme is a little out of date :( Try running the tests in a container ie) podman run -ti golang:1.15

@prarit
Copy link
Collaborator

prarit commented Oct 12, 2022

You can also just push it through github CI to see what is going on and debug from there.

@eXaminator
Copy link

Hey, I would love to see this feature! Are there any updates to this?

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.

None yet

5 participants