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

feat: New SCM and pull request ApplicationSet generators for Gitea #8989

Merged
merged 4 commits into from
Apr 7, 2022

Conversation

dmolik
Copy link
Contributor

@dmolik dmolik commented Apr 4, 2022

An initial implementation of Pull Request and SCM generators for Gitea.

API paging, and repo labels have not been implemented.

Signed-off-by: Dan Molik dan@danmolik.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@dmolik dmolik force-pushed the gitea branch 2 times, most recently from 903018b to 680a6a1 Compare April 4, 2022 17:01
@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #8989 (872b1b4) into master (86a646f) will increase coverage by 0.13%.
The diff coverage is 65.87%.

@@            Coverage Diff             @@
##           master    #8989      +/-   ##
==========================================
+ Coverage   45.00%   45.13%   +0.13%     
==========================================
  Files         212      214       +2     
  Lines       25272    25407     +135     
==========================================
+ Hits        11373    11468      +95     
- Misses      12292    12325      +33     
- Partials     1607     1614       +7     
Impacted Files Coverage Δ
applicationset/generators/pull_request.go 50.00% <0.00%> (-6.25%) ⬇️
applicationset/generators/scm_provider.go 47.69% <0.00%> (-5.76%) ⬇️
...is/applicationset/v1alpha1/applicationset_types.go 34.69% <ø> (ø)
applicationset/services/pull_request/gitea.go 63.33% <63.33%> (ø)
applicationset/services/scm_provider/gitea.go 77.10% <77.10%> (ø)
applicationset/services/scm_provider/github.go 63.52% <0.00%> (-17.65%) ⬇️
applicationset/services/scm_provider/gitlab.go 76.34% <0.00%> (+1.34%) ⬆️
applicationset/services/scm_provider/utils.go 88.50% <0.00%> (+4.59%) ⬆️
util/io/bytereadseeker.go 100.00% <0.00%> (+100.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86a646f...872b1b4. Read the comment docs.

An initial implementation of Pull Request and SCM generators for Gitea.

API paging, and repo labels have not been implemented.

Signed-off-by: Dan Molik <dan@danmolik.com>
re-trigger linting check

Signed-off-by: Dan Molik <dan@danmolik.com>
Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have time to put some test coverage on the new code?

I think mocks would be appropriate for testing generators/. For services/ we could either try to find a hosted gitea instance to rely on (like in the gitlab tests), try to spin one up in e2e tests, or just leave it untested.

applicationset/services/pull_request/gitea.go Outdated Show resolved Hide resolved
applicationset/services/scm_provider/gitea.go Show resolved Hide resolved
@crenshaw-dev
Copy link
Collaborator

I guess even the services/* files can be tested with giteaProvider and giteaService mocks.

Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dmolik
Copy link
Contributor Author

dmolik commented Apr 5, 2022

Okay I just need to rebase or sign my commit

@crenshaw-dev
Copy link
Collaborator

@dmolik yep looks like the most recent 2 commits need to be signed. I think the DCO check details should have instructions for signing multiple commits.

@dmolik
Copy link
Contributor Author

dmolik commented Apr 5, 2022

Yea I really should just turn auto signing on

Signed-off-by: Dan Molik <dan@danmolik.com>
Signed-off-by: Dan Molik <dan@danmolik.com>
@crenshaw-dev
Copy link
Collaborator

@rishabh625 if you're happy, I'll merge!

Copy link
Contributor

@rishabh625 rishabh625 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than 2 comments LGTM great work

@crenshaw-dev crenshaw-dev merged commit d00fa53 into argoproj:master Apr 7, 2022
@dmolik dmolik deleted the gitea branch April 7, 2022 13:36
ashutosh16 pushed a commit to ashutosh16/argo-cd that referenced this pull request Apr 9, 2022
…rgoproj#8989)

* feat: New SCM and pull request ApplicationSet generators for Gitea

An initial implementation of Pull Request and SCM generators for Gitea.

API paging, and repo labels have not been implemented.

Signed-off-by: Dan Molik <dan@danmolik.com>

* chore: white space in hack/test.sh

re-trigger linting check

Signed-off-by: Dan Molik <dan@danmolik.com>

* chore: add gitea_scm and gitea_pr tests

Signed-off-by: Dan Molik <dan@danmolik.com>

* bug: ensure gitea scm haspath detects directories correctly

Signed-off-by: Dan Molik <dan@danmolik.com>
Signed-off-by: asingh51 <Ashutosh_Singh@intuit.com>
wojtekidd pushed a commit to wojtekidd/argo-cd that referenced this pull request Apr 25, 2022
…rgoproj#8989)

* feat: New SCM and pull request ApplicationSet generators for Gitea

An initial implementation of Pull Request and SCM generators for Gitea.

API paging, and repo labels have not been implemented.

Signed-off-by: Dan Molik <dan@danmolik.com>

* chore: white space in hack/test.sh

re-trigger linting check

Signed-off-by: Dan Molik <dan@danmolik.com>

* chore: add gitea_scm and gitea_pr tests

Signed-off-by: Dan Molik <dan@danmolik.com>

* bug: ensure gitea scm haspath detects directories correctly

Signed-off-by: Dan Molik <dan@danmolik.com>
Signed-off-by: wojtekidd <wojtek.cichon@protonmail.com>
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

3 participants