[FIX] runbot: fix teams bundles done count#1428
Open
d-fence wants to merge 1 commit into
Open
Conversation
5655206 to
744f4a6
Compare
pparidans
reviewed
Jun 11, 2026
| @@ -910,11 +910,9 @@ def bundles_by_tag(self, bundle_tag_id=None, project=None, **kwargs): | |||
| bundles_by_team = defaultdict(list) | |||
| nb_bundles_done = 0 | |||
pparidans
reviewed
Jun 11, 2026
| bundles_by_team = defaultdict(list) | ||
| nb_bundles_done = 0 | ||
| bundles = self.env['runbot.bundle'].search([('tag_ids', 'in', bundle_tag_id.id)]) | ||
| nb_bundles_done = len(bundles.filtered(lambda b: b.has_pr and not b.has_active_pr)) |
Contributor
There was a problem hiding this comment.
not sure what's best between here and in the template as a <t t-set="..."/> 🤔
When counting bundles done, we need to differentiate bundles without any PR from bundles with closed PRs. Instead of dealing with unreadable filters, we take the opportunity to fix the unclear `has_pr` field. For a long time, the meaning of that field was to show bundles with active PRs. So we rename `has_pr` to `has_active_pr` and add another computed field `has_pr` which is true whenever a bundle has PRs, active or not. Requires an upgrade with upgrade-util.
744f4a6 to
0e8180c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When counting bundles done, we need to differentiate bundles without any PR from bundles with closed PR's.
With this commit, we count the done bundles for a team using the same filter as the count for all bundles.