fix(release-group): Enhance handling of yanked releases#6231
Conversation
…release-if-latest-was-yanked
Greptile SummaryThis PR enhances the handling of yanked releases in Key changes:
Issues found:
Confidence Score: 3/5Not safe to merge without fixing the two logic bugs that can cause AttributeError and spurious errors for apps with no releases. The intent of the PR is sound, but there are two concrete bugs: (1) press/press/doctype/release_group/release_group.py — specifically the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[get_next_apps loop over apps] --> B{app in mandatory_upgrades?}
B -- Yes --> C[Use mandatory release, continue]
B -- No --> D[Fetch latest_app_releases for source]
D --> E[Query yanked_releases hashes]
E --> F{len yanked == len latest\nOR source is erroneous?}
F -- No --> J[Use latest_app_releases as-is]
F -- Yes --> G{len yanked == len latest?}
G -- Yes --> H["frappe.throw ⚠️\n(BUG: also fires when both == 0)"]
G -- No --> I["find Stable release\n(BUG: can be None → [None])"]
I --> I2{is_first_deploy?}
I2 -- Yes --> K[latest_app_releases = empty]
I2 -- No --> L[latest_app_releases = last_stable_release]
J --> M{latest_app_release exists?}
K --> M
L --> M
M -- No --> N[skip app, continue]
M -- Yes --> O[Filter upcoming_releases by creation date]
O --> P[Append to next_apps]
Reviews (1): Last reviewed commit: "Merge branch 'develop' into fix-if-not-f..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (14.28%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #6231 +/- ##
===========================================
- Coverage 55.93% 55.93% -0.01%
===========================================
Files 908 910 +2
Lines 75685 75845 +160
Branches 525 525
===========================================
+ Hits 42334 42423 +89
- Misses 33323 33394 +71
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| # if the app source is erroneous, then we need to show the last stable release | ||
| # if it is not the first deploy, then we need to show last stable release and show no releases if it is the first deploy | ||
| last_stable_release = find(latest_app_releases, lambda x: x.status == "Stable") | ||
| if last_stable_release: |
There was a problem hiding this comment.
I am not sure if a Stable status exists
…stable-release-if-latest-was-yanked
No description provided.