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 last verified script #3154

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Add last verified script #3154

wants to merge 15 commits into from

Conversation

svekars
Copy link
Contributor

@svekars svekars commented Nov 8, 2024

  • Add a script that inserts Created On, Last Updated On, Verified On after the title in the tutorials
  • The .json with the tutorials audit data that is used for last verified is stored in the "last-reviewed-data-json" branch and downloaded via a new Makefile command
  • Modified the GH tutorilas-build workflow to fetch all log history.

Copy link

pytorch-bot bot commented Nov 8, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3154

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 1 Pending

As of commit 137f995 with merge base 3ba3a46 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@svekars svekars added the website Issues related to website rendering label Nov 11, 2024
@svekars svekars marked this pull request as ready for review November 27, 2024 05:42
@svekars svekars assigned malfet and unassigned malfet Nov 27, 2024
Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

Lots of unrelated files in this PR (which feels like a good changes on its own)
Please do not put scripts in a top-level folder, create scripts folder or use .jenkins one (which imo can be renamed to scripts, as Jenkins is no longer used for tutorials CI

@@ -44,6 +44,8 @@ jobs:
- name: Checkout Tutorials
uses: actions/checkout@v3
with:
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be done in separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need this to get the git history so that the Created On data is added correctly

@@ -0,0 +1,12 @@
:orphan:
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this unrelated to PR in question?

@@ -1,3 +1,5 @@
:orphan:
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks unrelated

@@ -1,3 +1,5 @@
:orphan:
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks unrelated

from bs4 import BeautifulSoup

# Check if the build directory is provided as an argument in the Makefile
if len(sys.argv) < 2:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please follow __main__ code pattern: https://docs.python.org/3/library/__main__.html

Comment on lines +44 to +60
def get_creation_date(file_path):
try:
result = subprocess.run(
["git", "log", "--diff-filter=A", "--format=%aD", "--", file_path],
capture_output=True,
text=True,
check=True,
)
if result.stdout:
creation_date = result.stdout.splitlines()[0]
creation_date = datetime.strptime(creation_date, "%a, %d %b %Y %H:%M:%S %z")
formatted_date = creation_date.strftime("%b %d, %Y")
else:
formatted_date = "Unknown"
return formatted_date
except subprocess.CalledProcessError:
return "Unknown"
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like get_last_updated and get_created could benefit from some refactoring of common code.
And why unknown is an accepted answer? Shouldn't it raise an exception that should be handled elsewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed website Issues related to website rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants