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

Allow setting argoCD revision to PR git Branch #16

Merged
merged 34 commits into from
Jul 12, 2024
Merged

Conversation

Oded-B
Copy link
Collaborator

@Oded-B Oded-B commented Jun 28, 2024

Description

  • New function SetArgoCDAppRevision sets ArgoCD application Target Revsion, note: It doesn't trigger a sync by itself , and it doesn't enable/disable autosync.
  • Create a new configuration to control which ArgoCD apps are allowed to sync to non main branch by Telefonistka
  • User triggers the SetArgoCDAppRevision function by checking a checkbox in the ArgoCD diff comment (the comment is displayed only for relevant apps), the will set the app target revision to the PR branch (=next commits in PR will be synced from this point and no diff will be displayed ).
  • On PR merge SetArgoCDAppRevision is used a gain to revert app to point to HEAD
  • generateListOfChangedComponentPaths function now includes the logic for promotion and "regular" PRs (for DRYness)
  • Refactor createArgoCdClient to create all needed clients (we need to cache those outside the stack at some point )
  • add analyzeCommentUpdateCheckBox function to support generic triggering of actions from checkbox

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jun 28, 2024

/publish

Copy link

oci-image-publish-on-comment: failed ❌
https://github.com/commercetools/telefonistka/actions/runs/9711978855
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-26ad53a

Copy link

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9711978855
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-26ad53a

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jun 28, 2024

/publish

Copy link

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9713159072
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-0a550ec

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jun 28, 2024

/publish

Copy link

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9714078263
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-63325cd

itself.
Comment.User.Login isn't relevant when editing a comment made by someone
else
@Oded-B
Copy link
Collaborator Author

Oded-B commented Jun 28, 2024

/publish

Copy link

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9714590552
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-f9b06af

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jun 28, 2024

/publish

Copy link

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9714748106
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-82225a3

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jul 1, 2024

/publish

Copy link

github-actions bot commented Jul 1, 2024

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9740062905
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-e4cbcad

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jul 1, 2024

/publish

Copy link

github-actions bot commented Jul 1, 2024

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9740862636
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-0c0d06f

refacore: move some of the complexity in to generateListOfRelevantComponents to make stuff more DRY
@Oded-B
Copy link
Collaborator Author

Oded-B commented Jul 1, 2024

/publish

Copy link

github-actions bot commented Jul 1, 2024

oci-image-publish-on-comment: failed ❌
https://github.com/commercetools/telefonistka/actions/runs/9741483066
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-8cb4c1a

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jul 1, 2024

/publish

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jul 2, 2024

/publish

Copy link

github-actions bot commented Jul 2, 2024

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9761425159
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-b69e031

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jul 3, 2024

/publish

Copy link

github-actions bot commented Jul 3, 2024

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9773720588
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-1f3ee4b

@Oded-B
Copy link
Collaborator Author

Oded-B commented Jul 3, 2024

/publish

Copy link

github-actions bot commented Jul 3, 2024

oci-image-publish-on-comment: succeeded ✅
https://github.com/commercetools/telefonistka/actions/runs/9775336954
ghcr.io/commercetools/telefonistka:sync_apps_to_branch
ghcr.io/commercetools/telefonistka:sha-4d88126

@Oded-B Oded-B marked this pull request as ready for review July 4, 2024 11:14
Copy link

gitstream-cm bot commented Jul 4, 2024

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

Copy link

gitstream-cm bot commented Jul 4, 2024

🥷 Code experts: no user but you matched threshold 10

Oded-B has most 👩‍💻 activity in the files.
Oded-B has most 🧠 knowledge in the files.

See details

docs/installation.md

Activity based on git-commit:

Oded-B
JUL
JUN 13 additions & 3 deletions
MAY 4 additions & 0 deletions
APR 11 additions & 0 deletions
MAR
FEB

Knowledge based on git-blame:
Oded-B: 36%

internal/pkg/argocd/argocd.go

Activity based on git-commit:

Oded-B
JUL
JUN 118 additions & 34 deletions
MAY 6 additions & 0 deletions
APR 273 additions & 0 deletions
MAR
FEB

Knowledge based on git-blame:
Oded-B: 100%

internal/pkg/configuration/config.go

Activity based on git-commit:

Oded-B
JUL
JUN 20 additions & 17 deletions
MAY 1 additions & 0 deletions
APR 5 additions & 3 deletions
MAR
FEB

Knowledge based on git-blame:
Oded-B: 41%

internal/pkg/githubapi/github.go

Activity based on git-commit:

Oded-B
JUL
JUN 127 additions & 22 deletions
MAY 8 additions & 1 deletions
APR 51 additions & 10 deletions
MAR
FEB

Knowledge based on git-blame:
Oded-B: 50%

internal/pkg/githubapi/github_test.go

Activity based on git-commit:

Oded-B
JUL
JUN 64 additions & 0 deletions
MAY
APR
MAR
FEB

Knowledge based on git-blame:
Oded-B: 100%

internal/pkg/githubapi/promotion.go

Activity based on git-commit:

Oded-B
JUL
JUN 27 additions & 7 deletions
MAY
APR 46 additions & 18 deletions
MAR
FEB

Knowledge based on git-blame:
Oded-B: 28%

templates/argoCD-diff-pr-comment.gotmpl

Activity based on git-commit:

Oded-B
JUL
JUN
MAY
APR 35 additions & 0 deletions
MAR
FEB

Knowledge based on git-blame:
Oded-B: 100%

To learn more about /:\ gitStream - Visit our Docs

@Oded-B Oded-B changed the title Allow setting argoCD revision to PR git SHA Allow setting argoCD revision to PR git Branch Jul 9, 2024
internal/pkg/argocd/argocd.go Outdated Show resolved Hide resolved
internal/pkg/argocd/argocd.go Outdated Show resolved Hide resolved
internal/pkg/argocd/argocd.go Outdated Show resolved Hide resolved
internal/pkg/argocd/argocd.go Outdated Show resolved Hide resolved
internal/pkg/argocd/argocd.go Outdated Show resolved Hide resolved
internal/pkg/githubapi/github.go Outdated Show resolved Hide resolved
internal/pkg/githubapi/github.go Show resolved Hide resolved
internal/pkg/githubapi/github_test.go Show resolved Hide resolved
internal/pkg/githubapi/promotion.go Outdated Show resolved Hide resolved
internal/pkg/githubapi/github.go Show resolved Hide resolved
Oded-B and others added 7 commits July 11, 2024 10:56
Co-authored-by: Hannes Gustafsson <[email protected]>
Removed unneeded JSON marshel error handeling(it should never fail)
Switched back Const to String - I need a pointer for it
the identifier paramatize)

This addresses a PR analyzeCommentUpdateCheckBox
@Oded-B Oded-B requested review from hnnsgstfssn and ashvarts July 12, 2024 09:29
@Oded-B Oded-B merged commit 2a96ff7 into main Jul 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants