diff --git a/.github/workflows/lifecycle-backlog.yml b/.github/workflows/lifecycle-backlog.yml index 8dfb5755..fd4ad576 100644 --- a/.github/workflows/lifecycle-backlog.yml +++ b/.github/workflows/lifecycle-backlog.yml @@ -53,7 +53,7 @@ jobs: - name: Run lifecycle processing script env: - GH_TOKEN: ${{ secrets.GH_DANGERBOT_TOKEN_LIMITED }} + GH_TOKEN: ${{ secrets.QCA_DATASET_SUBMISSION_PAT }} QCA_USER: ${{ secrets.QCA_USER }} QCA_KEY: ${{ secrets.QCA_KEY }} run: | diff --git a/.github/workflows/lifecycle-set-priority-computetag.yml b/.github/workflows/lifecycle-set-priority-computetag.yml index 8831c73d..a9dc0eb7 100644 --- a/.github/workflows/lifecycle-set-priority-computetag.yml +++ b/.github/workflows/lifecycle-set-priority-computetag.yml @@ -48,7 +48,7 @@ jobs: - name: Run lifecycle processing script env: - GH_TOKEN: ${{ secrets.GH_DANGERBOT_TOKEN_LIMITED }} + GH_TOKEN: ${{ secrets.QCA_DATASET_SUBMISSION_PAT }} QCA_USER: ${{ secrets.QCA_USER }} QCA_KEY: ${{ secrets.QCA_KEY }} run: | diff --git a/.github/workflows/lifecycle-submission.yml b/.github/workflows/lifecycle-submission.yml index 263e7efd..e5123e67 100644 --- a/.github/workflows/lifecycle-submission.yml +++ b/.github/workflows/lifecycle-submission.yml @@ -63,7 +63,7 @@ jobs: - name: Run lifecycle processing script env: - GH_TOKEN: ${{ secrets.GH_DANGERBOT_TOKEN_LIMITED }} + GH_TOKEN: ${{ secrets.QCA_DATASET_SUBMISSION_PAT }} QCA_USER: ${{ secrets.QCA_USER }} QCA_KEY: ${{ secrets.QCA_KEY }} run: | diff --git a/management/lifecycle.py b/management/lifecycle.py index a035220b..e7fbacbb 100755 --- a/management/lifecycle.py +++ b/management/lifecycle.py @@ -133,25 +133,36 @@ def execute_state(self, board=None, states=None, """Based on current state of the PR, perform appropriate actions. """ - if board is None: - board = _get_full_board(self.repo) + import projectsv2 - pr_card, pr_state = self._get_board_card_state(board, self.pr) + # we're going to give up on evolving boards entirely for now + if board is None: + board = projectsv2._get_full_board() + # look for the card + pr_state = None + pr_card = None + for col_name, cards in board.items(): + for card in cards: + if int(card.pr_number) == int(self.pr.number): + pr_card = card + pr_state = col_name + # pr_card, pr_state = self._get_board_card_state(board, self.pr) # if card not on board, then it starts in the Backlog - if pr_state is None: - pr_state = self.set_backlog() + # skip this completely, we can't do it + # if pr_state is None: + # pr_state = self.set_backlog() # reload board, since we just added this card - board = _get_full_board(self.repo) - pr_card, pr_state = self._get_board_card_state(board, self.pr) + # board = _get_full_board(self.repo) + # pr_card, pr_state = self._get_board_card_state(board, self.pr) # exit early if states specified, and this PR is not # in one of those if states is not None: if pr_state not in states: return - + if pr_state == "Backlog": return self.execute_backlog(pr_card, pr_state) elif pr_state == "Queued for Submission": @@ -199,7 +210,8 @@ def execute_backlog(self, pr_card, pr_state): comment = f""" ## Lifecycle - Backlog - Merged dataset moved from "Backlog" to "Queued for Submission". + Project boards are not working as expected. + However, please consider this queued for submission. """ @@ -209,11 +221,11 @@ def execute_backlog(self, pr_card, pr_state): # submit comment self.pr.create_issue_comment(comment) - self.evolve_state(pr_card, pr_state, "Queued for Submission") + # self.evolve_state(pr_card, pr_state, "Queued for Submission") - return {"new_state": "Queued for Submission"} - else: - return {"new state": "Backlog"} + # return {"new_state": "Queued for Submission"} + # else: + # return {"new state": "Backlog"} def execute_queued_submit(self, pr_card, pr_state): """Submit datasets, perhaps with some retry logic. @@ -231,8 +243,11 @@ def execute_queued_submit(self, pr_card, pr_state): results.append(ct.execute_queued_submit()) new_state = self.resolve_new_state(results) - if new_state is not None: - self.evolve_state(pr_card, pr_state, new_state) + # if new_state is not None: + # self.evolve_state(pr_card, pr_state, new_state) + + # comment status on PR + self.pr.create_issue_comment(f"## Current status - {new_state}\n\n Consider manually moving this.") def execute_errorcycle(self, pr_card, pr_state, reset_errors=False, @@ -259,8 +274,11 @@ def execute_errorcycle(self, pr_card, pr_state, set_computetag=set_computetag)) new_state = self.resolve_new_state(results) - if new_state is not None: - self.evolve_state(pr_card, pr_state, new_state) + # if new_state is not None: + # self.evolve_state(pr_card, pr_state, new_state) + + # comment status on PR + self.pr.create_issue_comment(f"## Current status - {new_state}\n\n Consider manually moving this.") if new_state == "Archived/Complete": for dataset in self.datasets: