sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #05942
[Merge] ~adam-collard/maas/+git/maas-release-tools:active-milestone-when-moving-bugs into ~maas-committers/maas/+git/maas-release-tools:main
Adam Collard has proposed merging ~adam-collard/maas/+git/maas-release-tools:active-milestone-when-moving-bugs into ~maas-committers/maas/+git/maas-release-tools:main.
Commit message:
[launchpad] temporarily open destination milestones when retargetting bugs
Requested reviews:
MAAS Committers (maas-committers)
For more details, see:
https://code.launchpad.net/~adam-collard/maas/+git/maas-release-tools/+merge/438909
--
Your team MAAS Committers is requested to review the proposed merge of ~adam-collard/maas/+git/maas-release-tools:active-milestone-when-moving-bugs into ~maas-committers/maas/+git/maas-release-tools:main.
diff --git a/maas_release_tools/launchpad.py b/maas_release_tools/launchpad.py
index 96a753a..cea786e 100644
--- a/maas_release_tools/launchpad.py
+++ b/maas_release_tools/launchpad.py
@@ -23,7 +23,6 @@ class UnknownLaunchpadEntry(Exception):
class LaunchpadActions:
-
lp: Launchpad
logger: logging.Logger
dry_run: bool
@@ -92,21 +91,27 @@ class LaunchpadActions:
):
"""Move bugs that are done from a milestone to another."""
origin = self.get_milestone(origin_milestone)
- dest = self.get_milestone(dest_milestone)
limit = (
datetime.fromisoformat(fixed_before).replace(tzinfo=timezone.utc)
if fixed_before
else None
)
- self._move_bugs(
- DONE_BUGS, origin, dest, dry_run=self.dry_run, fixed_before=limit
- )
+ with self._active_milestone(dest_milestone) as dest:
+ self._move_bugs(
+ DONE_BUGS,
+ origin,
+ dest,
+ dry_run=self.dry_run,
+ fixed_before=limit,
+ )
def move_unfinished_bugs(self, origin_milestone: str, dest_milestone: str):
"""Move bugs that are not done from a milestone to another."""
origin = self.get_milestone(origin_milestone)
- dest = self.get_milestone(dest_milestone)
- self._move_bugs(UNFINISHED_BUGS, origin, dest, dry_run=self.dry_run)
+ with self._active_milestone(dest_milestone) as dest:
+ self._move_bugs(
+ UNFINISHED_BUGS, origin, dest, dry_run=self.dry_run
+ )
def assign_bugs_to_milestone(
self, bugs: List[str], milestone_name: str
Follow ups