Skip to content

feat: Release pipelines logic v0.2.1 - #5763

Merged
gagantrivedi merged 6 commits into
mainfrom
fix/release-pipeline-audit-logs
Jul 22, 2025
Merged

feat: Release pipelines logic v0.2.1#5763
gagantrivedi merged 6 commits into
mainfrom
fix/release-pipeline-audit-logs

Conversation

@gagantrivedi

@gagantrivedi gagantrivedi commented Jul 16, 2025

Copy link
Copy Markdown
Member

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

How did you test this code?

Adds unit tests

@gagantrivedi
gagantrivedi requested a review from a team as a code owner July 16, 2025 08:20
@gagantrivedi
gagantrivedi requested review from khvn26 and removed request for a team July 16, 2025 08:20
@vercel

vercel Bot commented Jul 16, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jul 22, 2025 9:12am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jul 22, 2025 9:12am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jul 22, 2025 9:12am

@gagantrivedi
gagantrivedi marked this pull request as draft July 16, 2025 08:20
@github-actions github-actions Bot added the api Issue related to the REST API label Jul 16, 2025
@github-actions

github-actions Bot commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-5763 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-5763 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-5763 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-5763 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5763 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5763 Finished ✅ Results

@codecov

codecov Bot commented Jul 16, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.81%. Comparing base (58bdf04) to head (f8bad46).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5763      +/-   ##
==========================================
+ Coverage   97.77%   97.81%   +0.03%     
==========================================
  Files        1255     1257       +2     
  Lines       44357    44617     +260     
==========================================
+ Hits        43371    43643     +272     
+ Misses        986      974      -12     

☔ 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.

@gagantrivedi
gagantrivedi force-pushed the fix/release-pipeline-audit-logs branch 5 times, most recently from 40aaf9c to c2355c6 Compare July 21, 2025 08:33
@gagantrivedi gagantrivedi changed the title wip: audit logs feat: Release pipelines logic v0.2.0 Jul 21, 2025
@gagantrivedi
gagantrivedi marked this pull request as ready for review July 21, 2025 11:29
@github-actions github-actions Bot added the feature New feature or request label Jul 21, 2025

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor comment and open discussion

return RELEASE_PIPELINE_DELETED_MESSAGE % self.name

def has_feature_in_flight(self) -> bool:
return EnvironmentFeatureVersion.objects.filter( # type: ignore[no-any-return]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It pleases mypy to assign the variable with type to avoid the type ignore:

       has_feature_in_flight: bool = EnvironmentFeatureVersion.objects.filter(
            published_at__isnull=True, pipeline_stage__in=self.stages.all()
        ).exists()
        return has_feature_in_flight

self.published_by = None
self.save()

def clone(self) -> "ReleasePipeline":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As it was raised by emyller in this one.

It doesn't feel right to perform the cloning in the models as deep down it's logic business and it ends up with:

  • bloating the models
  • having the logic scattered between the pipeline, stage, trigger and action models
    while it indeed makes sense to have a service triggering the pipeline cloning and cascading down.

I'd be in favor to use a service

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we plan to add the new name in the pipeline (as for segment?). Do we want to implement it now in the backend in that case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, interesting point. I'd argue that there's not much business logic here—it's as simple as implementing a copy method, which should live on the class itself to be idiomatic Django. But I do see your point, and it leaves us with two ways of creating a duplicate of a model in our codebase. To avoid that, I'd move this to a service layer on release pipelines.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 22, 2025
Zaimwa9
Zaimwa9 previously approved these changes Jul 22, 2025

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@gagantrivedi gagantrivedi changed the title feat: Release pipelines logic v0.2.0 feat: Release pipelines logic v0.2.1 Jul 22, 2025
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Jul 22, 2025
@gagantrivedi
gagantrivedi merged commit e977ace into main Jul 22, 2025
30 checks passed
@gagantrivedi
gagantrivedi deleted the fix/release-pipeline-audit-logs branch July 22, 2025 09:22
khvn26 pushed a commit that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As a dashboard user, I should be able to track pipeline actions through audit logs

2 participants