Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add function to determine comment id for a job and use it #249

Merged
merged 3 commits into from
Feb 13, 2024

Conversation

trz42
Copy link
Contributor

@trz42 trz42 commented Feb 12, 2024

This is a follow up PR to sync bot codes used for EESSI and NESSI. It includes the following changes

  • adds function determine_pr_comment_id which reads the attribute pr_comment_id from the job's metadata file (all current bot instances already provide that attribute when creating the job's metadata file)
  • the function is then used when successful jobs are determined (in function determine_successful_jobs) and the comment id is added to a dictionary that contains information for each job
  • another function (determine_tarballs_to_deploy) adds the comment id to a dictionary storing information about jobs/tarballs to deploy
  • also includes slight code readability improvement by replacing a one letter variable name (s) with a more descriptive name (job)

- adds function `determine_pr_comment_id` which reads the attribute
  `pr_comment_id` from the job's metadata file (all current bot instances already
  provide that attribute when creating the job's metadata file)
- the function is then used when successful jobs are determined (in function
  `determine_successful_jobs`) and the comment id is added to a dictionary that
  contains information for each job
- another function (`determine_tarballs_to_deploy`) adds the comment id to a
  dictionary storing information about jobs/tarballs to deploy
@@ -74,6 +75,26 @@ def determine_job_dirs(pr_number):
return job_directories


def determine_pr_comment_id(job_dir):
Copy link
Contributor

Choose a reason for hiding this comment

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

It would probably be good to implement a test for this function, but I see that we don't have any tests for the functions in tasks/deploy.py, so this can be done later for all of them.

@bedroge bedroge merged commit 23dd5fe into EESSI:develop Feb 13, 2024
7 checks passed
This was referenced Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants