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

Closes #184 Automatically updating the date of new blog posts #222

Merged
merged 12 commits into from
Sep 16, 2024

Conversation

manciniedoardo
Copy link
Collaborator

Thank you for your Pull Request! We have developed this task checklist to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your blog post.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update), and make sure the corresponding issue is linked in the Development section on the right hand side
  • Run the script from CICD.R line by line to first check the spelling in your post and then to make sure your code is compatible with our code-style. Address any incongruences by following the instructions in the file!
  • Choose (possibly several) tag(s) or categories from the current list: c("Metadata", "SDTM", "ADaM", "TLG", "Shiny", "Community", "Conferences", "Submissions", "Technical") for your blog post. If you cannot find anything that fits your blog post, propose a new tag to the maintainers! Note: if you use a tag not from this list, the "Check Post Tags" CICD pipeline will error. We occasionally tidy up all tags for consistency.
  • Add a short description for your blog post in the description field at the top of the markdown document.
  • Blog post is short, personalized, reproducible and readable
  • Add a disclaimer at the top of your post, if appropriate (example: Disclaimer
    This blog contains opinions that are of the authors alone and do not necessarily reflect the strategy of their respective organizations.)
  • Address all merge conflicts and resolve appropriately
  • Assign two of us (@bms63, @manciniedoardo, @StefanThoma, @kaz462) as reviewers in the PR.
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@manciniedoardo
Copy link
Collaborator Author

The idea here is that posts now get created in a folder prefixed with zzz_DO_NOT_EDIT, and any time there is a push to main (e.g. when PRs are approved for new blog posts) any folders with that prefix get the folder name updated with the current date and the post date within them is also updated.

R/create_blogpost.R Outdated Show resolved Hide resolved
R/readme.md Outdated Show resolved Hide resolved
@StefanThoma
Copy link
Collaborator

Not a bad idea, but I don't understand how this will affect the main branch.
I think it will update the name of the folder during the CICD run, but it will not be merged back into main, so this would still have to be done manually? Or am I missing something?

@manciniedoardo
Copy link
Collaborator Author

Not a bad idea, but I don't understand how this will affect the main branch. I think it will update the name of the folder during the CICD run, but it will not be merged back into main, so this would still have to be done manually? Or am I missing something?

I tested this in a cicd_testing branch by putting cicd_testing instead of main in the workflow file. Basically it will be a push to main once the PR is merged, similar to how the vbump workflow functions.

Only question is whether we need to update the branch restrictions on main to enable this to work.

@StefanThoma
Copy link
Collaborator

Not a bad idea, but I don't understand how this will affect the main branch. I think it will update the name of the folder during the CICD run, but it will not be merged back into main, so this would still have to be done manually? Or am I missing something?

I tested this in a cicd_testing branch by putting cicd_testing instead of main in the workflow file. Basically it will be a push to main once the PR is merged, similar to how the vbump workflow functions.

Only question is whether we need to update the branch restrictions on main to enable this to work.

Hmm I think the part that says On push main or something just means that this will trigger the workflow to execute, but I don't think this will merge back into main.
Or where do you think this will merge into main?

@manciniedoardo
Copy link
Collaborator Author

@StefanThoma I'm testing again with dummy branches - possible that I got this wrong during my first test

@manciniedoardo
Copy link
Collaborator Author

@StefanThoma I'm testing again with dummy branches - possible that I got this wrong during my first test

You're right. I think we'd actually need to checkout main, do the update there, and then push?

@StefanThoma
Copy link
Collaborator

@StefanThoma I'm testing again with dummy branches - possible that I got this wrong during my first test

You're right. I think we'd actually need to checkout main, do the update there, and then push?

We also have to be mindful of the order, so that the date is adjusted before the publishing job runs, right?

@manciniedoardo
Copy link
Collaborator Author

@StefanThoma I'm testing again with dummy branches - possible that I got this wrong during my first test

You're right. I think we'd actually need to checkout main, do the update there, and then push?

We also have to be mindful of the order, so that the date is adjusted before the publishing job runs, right?

Great point - maybe this workflow should be added as a dependency of the publishing job?

@manciniedoardo
Copy link
Collaborator Author

Ok, it should be fixed now - took a couple of attempts... Thanks @StefanThoma!
image
P.S. still need to be weary of order of execution with publishing job

@manciniedoardo
Copy link
Collaborator Author

@StefanThoma I updated the publishing job as well with a needs: Update-post-dates statement.

Copy link
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

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

Whoa...

Copy link
Collaborator

@StefanThoma StefanThoma left a comment

Choose a reason for hiding this comment

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

LGTM!

@gigikenneth gigikenneth merged commit 3c67d17 into main Sep 16, 2024
5 checks passed
@gigikenneth gigikenneth deleted the 184_cicd_date_stamp branch September 16, 2024 13:41
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.

Documentation: PR Checklist or CI Actions for a date stamp update/reminder
4 participants