Skip to content

[FIX] runbot: fix teams bundles done count#1428

Open
d-fence wants to merge 1 commit into
19.0from
19.0-fix-team-bundles-done-moc
Open

[FIX] runbot: fix teams bundles done count#1428
d-fence wants to merge 1 commit into
19.0from
19.0-fix-team-bundles-done-moc

Conversation

@d-fence

@d-fence d-fence commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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.

@d-fence d-fence requested a review from pparidans June 11, 2026 08:32
@C3POdoo C3POdoo requested a review from a team June 11, 2026 08:35
@d-fence d-fence force-pushed the 19.0-fix-team-bundles-done-moc branch from 5655206 to 744f4a6 Compare June 11, 2026 11:00
Comment thread runbot/controllers/frontend.py Outdated
@@ -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

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.

not needed anymore

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))

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.

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.
@d-fence d-fence force-pushed the 19.0-fix-team-bundles-done-moc branch from 744f4a6 to 0e8180c Compare June 12, 2026 13:33
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