ska-ser-jira-checks is a pytest suite that checks the housekeeping status of your Jira project.
This test fails if an issue has not been updated within a reasonable period of time.
For items in the BACKLOG, the limit is 90 days. If an issue in the BACKLOG has not been updated in the last 90 days, it's time to reassess this issue, and ask if it is still worth doing. If so, add a comment that the issue has been reviewed and retained. Otherwise, discard it.
For "To Do" items, the limit is 30 days. If an issue exceeds the 30-day limit, ask whether this is still a task that is part of the team plan, and which the team intends to do imminently. If so, add a comment to that effect. Otherwise, push it back to the BACKLOG, or discard it.
For items that are already in progress ("In Progress", "Reviewing", "BLOCKED", or "READY FOR ACCEPTANCE), the limit is 30 days. Investigate why this issue has not progressed.
"BACKLOG" and "To Do" issues generally won't have an assignee, but issues that are "In Progress, "Reviewing", "READY FOR ACCEPTANCE", "Done", or "BLOCKED" should.
This test fails if more than 4 "In Progress" issues are assigned to the same person.
This test fails if more than 2 "BLOCKED" issues are assigned to the same person.
This test checks that all issues (that are not already "Done") are assigned within the project team.
This is a useful check for when a team member leaves: the test will fail if work remains assigned to that team member after the Jira project membership has been updated to remove them.
Note: This test requires accessing a list of users that belong to the "Developer" role of the project being checked. This requires elevated permissions, generally only held by the Scrum Master / Agile Coach of the team that works on the project being checked. When run by a user who lacks these permissions (such as in the CI pipeline) this test is skipped.
Test that everyone in the project team has a ticket "In Progress".
(This test might not be appropriate to all teams. This is yet to be determined.)
Note: This test requires accessing a list of users that belong to the "Developer" role of the project being checked. This requires elevated permissions, generally only held by the Scrum Master / Agile Coach of the team that works on the project being checked. When run by a user who lacks these permissions (such as in the CI pipeline) this test is skipped.
It's okay for a ticket in the BACKLOG to be lacking a description, but once a ticket has been promoted to "To Do" or beyond, a description should be required.
Issues in the BACKLOG need not be assigned to a PI (i.e. a fixVersion). But promoting a issue to "To Do" indicates an intent to work on it imminently, so 'To Do' issues should have a PI, as should issues that are 'In Progress' etc.
Strictly speaking, "Done" issues should have an fixVersion too; but this test does not check 'Done' issues, because the past is the past.
It's okay for "Done" issues to have an old fixVersion, but other issues should link to a current or future fixVersion (or not be linked to a fixVersion at all).
TODO: This test needs work: an issue can has multiple fixVersions. If an issue fixVersion contains a current or future PI, it shouldn't matter if it also contains an older PI.
Within team projects, every issue should be either the "Child of" a feature, or "Relates to" an objective.
Sometimes issues are mis-linked to be "Child of" an objective.
Sometimes issues are mis-linked to "Relates to" a feature.
If an issue has commits, work has already started on it, so it probably shouldn't be 'To Do' or 'Backlog'.
Writing outcomes should be a pre-requisite to moving a ticket to RFA.
Sometimes an issue is moved to READY FOR ACCEPTANCE or Done prematurely, while that are still unmerged MRs.
While waiting for the MR to merge, move the issue back to "In Progress" or "Reviewing" or "Blocked". If the MR doesn't need to merge, close it.
If there are more than 9 READY FOR ACCEPTANCE issues, your Product Owner needs to be prodded to review and accept them.
The easiest way to use this tool is via its CI pipeline.
-
Go to the Run Pipeline page.
-
Add a
JIRA_PROJECT
variable whose value is the slug of the project that you want to check, such asMCCS
,BANG
,LOW
, etc. -
Click "Run pipeline", wait for it to run, then examine the output of the
python-test
step.
Note: If your project is well unkempt,
and the list of failures dauntingly large,
you can go back to step 2 and also add a JIRA_START_DATE
key,
with the value a date of the form 2024-09-11
and all issues created before that date will be disregarded.
-
Clone this repo.
-
Use
poetry install
to install into the environment of your choice. -
Set appropriate values for these three environment variables:
JIRA_USERNAME
,JIRA_PASSWORD
andJIRA_PROJECT
. -
Run
pytest
Note: If you want to add your own tests to the test suite,
that are specific to your project and should not be checked in,
add them to a test_custom.py
file.
This filename is already gitignored.
This project has a devcontainer definition,
that loads environment variables from .devcontainer/secrets.env
,
which is gitignored.
Create your own file of that name, with content like
JIRA_USERNAME=my.username
JIRA_PASSWORD=SekretPa$$w0rd
JIRA_PROJECT=MYPROJ
and those variables will be set whenever you launch your devcontainer.