Skip to content

Conversation

@jennyhickson
Copy link
Collaborator

@jennyhickson jennyhickson commented Jan 29, 2026

PR Summary

Sci/Tech Reviewer:
Code Reviewer: @james-bruten-mo

I've pulled the code for interacting with a github project into its own module as I would like to use this for a new script too. I've refactored workload.py to use this, and modified the interface to hopefully make it a little more generic. I've also removed the hardcoded list of repositories from workload.py, instead now including columns in the SSD table for all repos that have PRs in the project so that everything is included. This is lots at the moment as we had some wide-reaching workflow updates, but hopefully in the future this will actually reduce the size of the table to not include empty columns.

I've also updated the repository list in the manage milestones list to be more complete and fixed a bug with "'s.

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • This change has been tested appropriately (please describe)

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Security considerations have been addressed
  • Performance impact is acceptable

@jennyhickson jennyhickson marked this pull request as draft January 29, 2026 14:36
@jennyhickson jennyhickson marked this pull request as ready for review January 29, 2026 16:25
Copy link
Collaborator

@james-bruten-mo james-bruten-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of the classmethod!
A couple of minor suggestions

self.test = test

@classmethod
def from_github(cls, capture: bool = False, file: Path = None) -> "ProjectData":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def from_github(cls, capture: bool = False, file: Path = None) -> "ProjectData":
def from_github(cls, capture: bool = False, file: Path = None) -> ProjectData:

And then you'll need from __future__ import annotations. You actually don't need the import at python 14.0, but we're not commonly using that yet

Retrieve data from GitHub API and initialise the class.
"""
command = "gh project item-list 376 -L 500 --owner MetOffice --format json"
output = subprocess.run(command.split(), capture_output=True, timeout=180)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
output = subprocess.run(command.split(), capture_output=True, timeout=180)
output = subprocess.run(shlex.split(command), capture_output=True, timeout=180)

and import shlex - I learnt this one recently, it's great!

store it in a dictionary keyed by repository.
"""

data = {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
data = {}
data = defaultdict(list)

with from collections import defaultdict

And then below there's no need to check if repo is in data. Just do data[repo].append(pull_request) and it'll create it

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