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

Git Pull-Push checker #1283

Merged
merged 23 commits into from
Jan 15, 2024
Merged

Conversation

wwwlde
Copy link
Contributor

@wwwlde wwwlde commented Oct 2, 2023

Hello,

I'm not sure if you need this, but for my purposes (calculating SLO) I've created this checker for GitLab. The goal was simple - to ensure that it's possible to fetch and send commits. If there are any comments or feedback, I'll try to find the time to fix/add something. I'd be very grateful if you could approve this PR request.

image
image
image
image

Have a great day!

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2023

CLA assistant check
All committers have signed the CLA.

api/v1/checks.go Outdated Show resolved Hide resolved
api/v1/checks.go Outdated Show resolved Hide resolved
checks/gitlab.go Outdated Show resolved Hide resolved
@moshloop
Copy link
Member

moshloop commented Oct 2, 2023

Hi @wwwlde

Thank you for contribution ! - Just a couple small items should be good to merge

@wwwlde wwwlde force-pushed the gitlab-pull-push-checker branch 5 times, most recently from c518946 to e4bb0bc Compare October 3, 2023 01:34
@wwwlde
Copy link
Contributor Author

wwwlde commented Oct 3, 2023

@moshloop Hello, could you take a look at the PR again? Is everything as you expected now?

Thanks in advance!

@wwwlde wwwlde requested a review from moshloop October 3, 2023 18:24
checks/git_protocol.go Outdated Show resolved Hide resolved
api/v1/checks.go Outdated Show resolved Hide resolved
checks/git_protocol.go Outdated Show resolved Hide resolved
@wwwlde wwwlde force-pushed the gitlab-pull-push-checker branch 3 times, most recently from 256344a to 3ea7278 Compare October 4, 2023 22:04
@wwwlde wwwlde requested a review from moshloop October 4, 2023 22:05
@wwwlde wwwlde force-pushed the gitlab-pull-push-checker branch 2 times, most recently from 70db096 to 0b2b542 Compare October 6, 2023 16:00
@wwwlde
Copy link
Contributor Author

wwwlde commented Oct 10, 2023

@moshloop I fixed the linter for CRD.

P.S. I hope everything is fine with you and you are safe. Victory and peace to Israel!

@moshloop
Copy link
Member

@wwwlde thank you for the support

Can we add back the fixture and use these setup files to create a gogs server we can test against?

https://gist.github.com/moshloop/d2cc77696a543588b863cece88e29969

@wwwlde wwwlde marked this pull request as draft October 21, 2023 22:28
@wwwlde wwwlde marked this pull request as ready for review January 4, 2024 11:40
@moshloop
Copy link
Member

moshloop commented Jan 4, 2024

@wwwlde I am still reluctant to merge without a test fixture - In this PR I added a Gitea test server with a secret that should make reintroducing the test fixture pretty easy: #1557

@wwwlde
Copy link
Contributor Author

wwwlde commented Jan 5, 2024

@wwwlde I am still reluctant to merge without a test fixture - In this PR I added a Gitea test server with a secret that should make reintroducing the test fixture pretty easy: #1557

I apologize, I was just about to upload it yesterday but didn't manage to. I did it through gogs, but I see gitea already. Could you please check if this version is okay? Thank you in advance!

@wwwlde
Copy link
Contributor Author

wwwlde commented Jan 8, 2024

@wwwlde I am still reluctant to merge without a test fixture - In this PR I added a Gitea test server with a secret that should make reintroducing the test fixture pretty easy: #1557

I apologize, I was just about to upload it yesterday but didn't manage to. I did it through gogs, but I see gitea already. Could you please check if this version is okay? Thank you in advance!

@moshloop Hello, could you please review the PR now? Is everything okay?

@moshloop
Copy link
Member

moshloop commented Jan 8, 2024

@wwwlde Looking good :) - Can you move the creation of the github token into if statement as it will fail in tests on forks (but the git protocol test shouls still pass):

# creating a GITHUB_TOKEN Secret
if [[ -z "${GH_TOKEN}" ]]; then
    printf "\nEnvironment variable for github token (GH_TOKEN) is missing!!!\n"
else
    printf "\nCreating secret from github token ending with '${GH_TOKEN:(-8)}'\n"
    kubectl create secret generic github-token --from-literal=GITHUB_TOKEN="${GH_TOKEN}" --namespace canaries
    kubectl get secret github-token -o yaml --namespace canaries
fi

@wwwlde
Copy link
Contributor Author

wwwlde commented Jan 8, 2024

@wwwlde Looking good :) - Can you move the creation of the github token into if statement as it will fail in tests on forks (but the git protocol test shouls still pass):

# creating a GITHUB_TOKEN Secret
if [[ -z "${GH_TOKEN}" ]]; then
    printf "\nEnvironment variable for github token (GH_TOKEN) is missing!!!\n"
else
    printf "\nCreating secret from github token ending with '${GH_TOKEN:(-8)}'\n"
    kubectl create secret generic github-token --from-literal=GITHUB_TOKEN="${GH_TOKEN}" --namespace canaries
    kubectl get secret github-token -o yaml --namespace canaries
fi

@moshloop Done

@wwwlde
Copy link
Contributor Author

wwwlde commented Jan 10, 2024

@wwwlde Looking good :) - Can you move the creation of the github token into if statement as it will fail in tests on forks (but the git protocol test shouls still pass):

# creating a GITHUB_TOKEN Secret
if [[ -z "${GH_TOKEN}" ]]; then
    printf "\nEnvironment variable for github token (GH_TOKEN) is missing!!!\n"
else
    printf "\nCreating secret from github token ending with '${GH_TOKEN:(-8)}'\n"
    kubectl create secret generic github-token --from-literal=GITHUB_TOKEN="${GH_TOKEN}" --namespace canaries
    kubectl get secret github-token -o yaml --namespace canaries
fi

@moshloop Done

@moshloop I also fixed the issue with the linters.

@wwwlde
Copy link
Contributor Author

wwwlde commented Jan 11, 2024

@moshloop Hello,

May I inquire if there is anything else needed? What I have done in the tests seems correct, but they are still failing - you might want to take a look to see what's wrong.

@moshloop
Copy link
Member

@wwwlde Looks like the failing tests are unrelated now, merging :)

@moshloop moshloop merged commit aa23533 into flanksource:master Jan 15, 2024
12 of 14 checks passed
@wwwlde
Copy link
Contributor Author

wwwlde commented Jan 15, 2024

🎉🎉🎉 @moshloop Thanks!

@wwwlde wwwlde deleted the gitlab-pull-push-checker branch January 15, 2024 22:28
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.

5 participants