Skip to content

feat(argocd): add posthog events for argocd connect form and environment access#2728

Merged
RemiBonnet merged 2 commits into
stagingfrom
feat/posthog-argocd-events
Jun 2, 2026
Merged

feat(argocd): add posthog events for argocd connect form and environment access#2728
RemiBonnet merged 2 commits into
stagingfrom
feat/posthog-argocd-events

Conversation

@jul-dan
Copy link
Copy Markdown
Contributor

@jul-dan jul-dan commented Jun 2, 2026

Summary

Issue: QOV-1960

Add argoCD posthog events:

  • for connect form success/error
  • for ArgoCD env access

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

jul-dan and others added 2 commits June 2, 2026 11:27
…ent access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.15%. Comparing base (5393afd) to head (fdef51f).

Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2728      +/-   ##
===========================================
- Coverage    46.98%   44.15%   -2.84%     
===========================================
  Files         1193      599     -594     
  Lines        24905    14705   -10200     
  Branches      7292     4355    -2937     
===========================================
- Hits         11702     6493    -5209     
+ Misses       11168     7067    -4101     
+ Partials      2035     1145     -890     
Flag Coverage Δ
unittests 44.15% <100.00%> (-2.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

const isEnvironmentManagedByArgoCd = isArgoCdEnvironment(environmentOverview?.[0])

useEffect(() => {
if (isEnvironmentManagedByArgoCd) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure about this one, why we don't trigger an event when we see the environment is tagged with ArgoCD?

We try to avoid having too much useEffect in the code-base

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We want to track when a user access his argoCD environment not only when the environment is created.

by what it is the best to replace useEffect? Can we add a rule in the AGENTS.md because I noticed must of the time AI want to put useEffect everywhere

Copy link
Copy Markdown
Member

@RemiBonnet RemiBonnet Jun 2, 2026

Choose a reason for hiding this comment

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

On the ‎/environment/:id/overview page you can see the “ArgoCD” tag, and in this request https://api.qovery.com/environment/205753b2-26f9-4bb0-a333-841976081865/services you can see the service_type ARGO_CD‎ to track

Is it possible to track this from there? I feel it might not be necessary to add a custom event for it

Screenshot 2026-06-02 at 14 47 52

BTW, we have already a rule about useEffect in our skill with all alternatives

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can not track just with element displayed he has to perform an action on it. And not sure what you mean for the request because I don't have this information in posthog.

🙏🏻 thanks for the rule I am checking

Copy link
Copy Markdown
Member

@RemiBonnet RemiBonnet Jun 2, 2026

Choose a reason for hiding this comment

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

But here we just want to know if the user is on the environment overview with ArgoCD services, right? It’s more a page/view exposure than an action

If we can’t track it reliably from PostHog alone, useEffect sounds ok for this kind of analytics event

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

YEs it is not possible directly in Posthog that's why I added a custom event.

@RemiBonnet RemiBonnet self-requested a review June 2, 2026 16:10
@RemiBonnet RemiBonnet merged commit dba2c9d into staging Jun 2, 2026
11 of 12 checks passed
@RemiBonnet RemiBonnet deleted the feat/posthog-argocd-events branch June 2, 2026 16:10
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.

2 participants