Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

feat: GitHub App integration #180

Merged
merged 11 commits into from
Mar 4, 2021

Conversation

ryota-sakamoto
Copy link
Member

@ryota-sakamoto ryota-sakamoto commented Feb 16, 2021

refs: #99

Remaining work:

  • write test
  • write doc

@codecov
Copy link

codecov bot commented Feb 16, 2021

Codecov Report

Merging #180 (3369b56) into master (2bc3652) will decrease coverage by 1.15%.
The diff coverage is 36.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #180      +/-   ##
==========================================
- Coverage   52.69%   51.53%   -1.16%     
==========================================
  Files          33       34       +1     
  Lines        1577     1690     +113     
==========================================
+ Hits          831      871      +40     
- Misses        586      647      +61     
- Partials      160      172      +12     
Impacted Files Coverage Δ
expr/repo/repo.go 22.00% <0.00%> (ø)
pkg/services/github.go 28.57% <28.57%> (ø)
pkg/services/services.go 25.00% <28.57%> (+0.30%) ⬆️
pkg/config.go 53.84% <66.66%> (+5.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 2bc3652...3369b56. Read the comment docs.

@ryota-sakamoto ryota-sakamoto force-pushed the github-apps-intergration branch 3 times, most recently from 18631f1 to 4187b4e Compare February 16, 2021 17:41
@alexmt
Copy link
Collaborator

alexmt commented Feb 17, 2021

@ryota-sakamoto the PR looks awesome! It makes integration with Github much easier. Thank you!

@ryota-sakamoto ryota-sakamoto marked this pull request as ready for review February 19, 2021 15:15
@ryota-sakamoto ryota-sakamoto changed the title WIP: GitHub App integration GitHub App integration Feb 19, 2021
@ryota-sakamoto ryota-sakamoto changed the title GitHub App integration feat: GitHub App integration Feb 19, 2021
@ryota-sakamoto
Copy link
Member Author

@alexmt

It makes integration with Github much easier

I think so too, it is very easy.

I'm finished implementation and test, could you review this PR?

Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

Sorry, the review took some time since I was on a short vacation.

PR looks great. Added one proposal to allow extending github integration in the future.

@@ -60,6 +60,34 @@ func replaceStringSecret(val string, secretValues map[string][]byte) string {
})
}

func replaceServiceConfigSecret(data map[string]interface{}, secretValues map[string][]byte) map[string]interface{} {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this change required to make replacement more accurate and avoid accidentally produce invalid YAML?

The change looks good to me, just want to understand why it was required.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's right.
Currently, argocd-notifications-secret is not supported to set multiline value such as private key.
If the user set multiline value, invalid data format of yaml will be created.

template.app-deployed: |
message: |
Application {{.app.metadata.name}} is now running new version of deployments manifests.
github:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to leave room for additional actions such as create commit comment or create pull request (e.g. to create PR that rollback commit if app degrades). To allow adding actions we just need to move state, label and targetURL fields under status field:

github:
  status:  
    state: success
    label: "continuous-delivery/{{.app.metadata.name}}"
    targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is good idea.
It can be easily added more actions and github.status is more correctly than github.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thank you!

@ryota-sakamoto
Copy link
Member Author

Hi @alexmt
I fixed it, and please check it.

Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM.

Thank you @ryota-sakamoto !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants