Skip to content

Commit e0fd2ea

Browse files
validbecknrichersgithub-actions[bot]
authored
Merge pull request #630 from validmind/staging
* Add make execute PROFILE=exe-prod to docs-site action (#598) * Add execute PROFILE=exe-prod to Docker image build * Move notebook execution into docs-site action * Docs — Customize model overview page (#622) * Draft customize-model-overview-page.qmd * Quick instructions * Edits based on feedback from Rod * Updated docs — Workflows (#620) * Tweak to release generation notebook * Wait, gotta make the file first * Wording in notebook * Just being picky about spaces now * Adding open file to yearly_cleanup.py too * Success * Edits to customize-model-lifecycle-statuses.qmd * New img - working-with-model-workflows.qmd > See workflow statuses * +reset-workflow.gif to working-with-model-workflows.qmd * Updated set-up-model-workflows.qmd > Configure workflow steps * Updated configure-user-action.png * Updated approval-group-setup.png * Redid the Approval Step example/images * Redid the Condition Branch example/images * Changed linked-workflow image to a gif * Updated set-up-model-workflows.qmd > Link approval steps * Changed my mind about the model-workflows.png screencap * Tweak * Simplifying based on Rod's suggestion * QoL improvements to release notes script/notebooks (#626) * Testing adding the year to generated release notes * oops, forgot to parse the date format * Now the folder is swapped ugh * Adding the year to the _quarto.yml entry * Oops, forgot to add the input * Casing * Adding new year folder to index function * Grabbing yearly folders in established year * Fake 2025 releases for testing & modifying Makefile command * Fake 2026 release for yearly cleanup test * Trying the yearly lookup again * Yearly lookup works * Retrieve year folder * Commenting out move releases for now * Removed move releases * Modifying update_quarto_yaml * Cleaning up the Makefile command * Notebook wording cleanup * Removing test files & reverting _quarto.yml & index.qmd to main * Added aliases for moved 2024 releases * Added aliases for moved 2023 releases * Whoops, wrong alias for some of the super old releases * Nitpicky edit * Meh * Nitpicking the output * Added instructions for Wait steps in workflows (#628) * Edits to date & date-time custom fields * Wait step draft * Edits & footnotes --------- Co-authored-by: Nik Richers <nik@validmind.ai> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2 parents 68939d3 + 862b456 commit e0fd2ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+414
-342
lines changed

release-scripts/generate-release-notes.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@
222222
"\n",
223223
"### Create release folder and file\n",
224224
"\n",
225-
"These lines will create a folder inside of `~/site/releases` for the release notes with a new `release-notes.qmd` file. The folder name is the release date, as per our convention. \n",
225+
"These lines will create a folder inside of `~/site/releases` for the new release notes to live in and sets stage for the release notes to be generated. The folder name is the release date tucked into the yearly folder, as per our convention. \n",
226226
"\n",
227-
"**If the directory and file already exists, you will be prompted to confirm whether or not you want to overwrite the contents.**"
227+
"**If the directory and release file already exists, you will be prompted to confirm whether or not you want to overwrite the contents.**"
228228
]
229229
},
230230
{
@@ -233,7 +233,7 @@
233233
"metadata": {},
234234
"outputs": [],
235235
"source": [
236-
"output_file = gro.create_release_folder(gro.formatted_release_date)"
236+
"output_file, year = gro.create_release_folder(gro.formatted_release_date)"
237237
]
238238
},
239239
{
@@ -243,7 +243,9 @@
243243
"<a id='toc3_2_'></a>\n",
244244
"\n",
245245
"### Add the date to release notes \n",
246-
"This block writes the specified date as the title of the new release notes file."
246+
"This block writes the specified date as the title of the new release notes file.\n",
247+
"\n",
248+
"**It will also open up the newly created `release-notes.qmd` file for you so you don't have to go looking for it.**"
247249
]
248250
},
249251
{
@@ -565,7 +567,7 @@
565567
"metadata": {},
566568
"outputs": [],
567569
"source": [
568-
"gro.update_quarto_yaml(gro.release_datetime)"
570+
"gro.update_quarto_yaml(gro.release_datetime, year)"
569571
]
570572
},
571573
{
@@ -584,7 +586,7 @@
584586
"metadata": {},
585587
"outputs": [],
586588
"source": [
587-
"gro.update_index_qmd(gro.release_datetime)"
589+
"gro.update_index_qmd(gro.release_datetime, year)"
588590
]
589591
},
590592
{

release-scripts/generate_release_objects.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,11 @@ def create_release_folder(formatted_release_date):
440440
Returns:
441441
str: The path to the release notes file, or exits the script if the user chooses not to overwrite.
442442
"""
443-
directory_path = f"../site/releases/{formatted_release_date}/"
443+
# Parse the input date
444+
parsed_date = datetime.datetime.strptime(formatted_release_date, "%Y-%b-%d")
445+
year = parsed_date.year
446+
formatted_date = parsed_date.strftime("%Y-%b-%d").lower() # e.g., "2025-jan-17"
447+
directory_path = f"../site/releases/{year}/{formatted_date}/"
444448
output_file = f"{directory_path}release-notes.qmd"
445449

446450
# Check if the directory and file already exist
@@ -453,7 +457,8 @@ def create_release_folder(formatted_release_date):
453457
# Create directory and output file
454458
os.makedirs(directory_path, exist_ok=True)
455459
print(f"{output_file} will be created or overwritten")
456-
return output_file
460+
461+
return output_file, year
457462

458463
def create_release_qmd(output_file, original_release_date):
459464
"""
@@ -468,6 +473,11 @@ def create_release_qmd(output_file, original_release_date):
468473
with open(output_file, "w") as file:
469474
file.write(f"---\ntitle: \"{original_release_date}\"\n---\n\n")
470475

476+
try:
477+
subprocess.run(["code", output_file], check=True)
478+
except Exception as e:
479+
print(f"Error opening the file in VS Code: {e}")
480+
471481
def update_release_components(release_components, categories):
472482
"""
473483
Updates a dictionary of release components with the given categories.
@@ -721,7 +731,7 @@ def upgrade_info(output_file):
721731
except Exception as e:
722732
print(f"Failed to include _how-to-upgrade.qmd to {output_file}: {e}")
723733

724-
def update_quarto_yaml(release_date):
734+
def update_quarto_yaml(release_date, year):
725735
"""Updates the _quarto.yml file to include the release notes file so it can be accessed on the website.
726736
727737
Params:
@@ -734,7 +744,7 @@ def update_quarto_yaml(release_date):
734744

735745
# Format the release date for insertion into the YAML file
736746
formatted_release_date = release_date.strftime("%Y-%b-%d").lower()
737-
target_line = f' - releases/{formatted_release_date}/release-notes.qmd\n'
747+
target_line = f' - releases/{year}/{formatted_release_date}/release-notes.qmd\n'
738748

739749
# Check if the target line already exists in the YAML file
740750
with open(yaml_filename, 'r') as file:
@@ -769,7 +779,7 @@ def update_quarto_yaml(release_date):
769779

770780
print(f"Added new release notes to _quarto.yml, line {insert_index + 2}")
771781

772-
def update_index_qmd(release_date):
782+
def update_index_qmd(release_date, year):
773783
"""Updates the index.qmd file to include the new releases in `Latest Releases` and removes the oldest release from the list.
774784
775785
Params:
@@ -783,7 +793,7 @@ def update_index_qmd(release_date):
783793

784794
# Format the release date for checking and insertion into the QMD file
785795
formatted_release_date = release_date.strftime("%Y-%b-%d").lower()
786-
new_release_entry = f' - /releases/{formatted_release_date}/release-notes.qmd\n'
796+
new_release_entry = f' - /releases/{year}/{formatted_release_date}/release-notes.qmd\n'
787797

788798
# Check if the release note already exists
789799
with open(index_filename, 'r') as file:
@@ -905,7 +915,7 @@ def main():
905915
print()
906916

907917
# Handle potential failure in create_release_folder
908-
output_file = create_release_folder(formatted_release_date)
918+
output_file, year = create_release_folder(formatted_release_date)
909919
if not output_file: # Ensure the function returns something valid
910920
raise RuntimeError("Failed to create release folder.")
911921
print()
@@ -959,10 +969,10 @@ def main():
959969
upgrade_info(output_file)
960970
print()
961971

962-
update_quarto_yaml(release_datetime)
972+
update_quarto_yaml(release_datetime, year)
963973
print()
964974

965-
update_index_qmd(release_datetime)
975+
update_index_qmd(release_datetime, year)
966976
print()
967977

968978
except Exception as e:

release-scripts/year-end-cleanup.ipynb

Lines changed: 30 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Year end release cleanup"
7+
"# Year-end release cleanup"
88
]
99
},
1010
{
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"This notebook automatically moves a full year of releases into their own subdirectory under `~site/releases/` and collates the releases into their yearly listing page, including a preliminary tidy up of any links broken by moving these files. \n",
14+
"This notebook automatically collates a full year of releases into a yearly listing page under `~site/releases/` , including a preliminary tidy up of any links broken by moving these files. \n",
1515
"\n",
16-
"It's easiest to run this notebook at the start of the new year, when all the releases for the previous year are ready to be collated, thus requiring minimum adjustment from you.\n",
16+
"It's easiest to run this notebook at the start of the new year, when all the releases for the previous year are ready to be collected, thus requiring minimum adjustment from you.\n",
1717
"\n",
18-
"After running the notebook, you can locate the new yearly release subdirectory that was inserted into our `About > Releases` section for you to clean up further, along with a live preview of the site to get you started."
18+
"After running the notebook, you can review the new yearly release listing page that was inserted into our `About > Releases` section for you to clean up further, along with a live preview of the site to get you started."
1919
]
2020
},
2121
{
@@ -28,18 +28,15 @@
2828
" - [Import yearly cleanup script](#toc2_1_) \n",
2929
" - [Specify the year](#toc2_2_) \n",
3030
" - [Retrieve matching release folders](#toc2_3_) \n",
31-
"- [Creating the yearly folder](#toc3_) \n",
32-
" - [Create the yearly folder](#toc3_1_) \n",
33-
" - [Move releases into yearly folder](#toc3_2_) \n",
34-
" - [Create yearly listing page](#toc3_3_) \n",
35-
" - [Edit the yearly listing page](#toc3_4_) \n",
36-
" - [Retrieve moved releases](#toc3_5_) \n",
37-
" - [Add moved releases to listing page](#toc3_6_) \n",
31+
"- [Rounding up the yearly releases](#toc3_) \n",
32+
" - [Retrieve the yearly folder](#toc3_1_) \n",
33+
" - [Create yearly listing page](#toc3_2_) \n",
34+
" - [Edit the yearly listing page](#toc3_3_) \n",
35+
" - [Retrieve yearly release pages](#toc3_4_) \n",
36+
" - [Add releases to yearly listing page](#toc3_5_) \n",
3837
"- [Updating sidebar and links](#toc4_) \n",
3938
" - [Add yearly release folder to sidebar](#toc4_1_) \n",
40-
" - [Move year end marker](#toc4_2_) \n",
41-
" - [Fix broken filepaths](#toc4_3_) \n",
42-
" - [Retrieve relative paths](#toc4_4_) \n",
39+
" - [Move year end marker](#toc4_2_) \n",
4340
"- [Next steps](#toc5_) \n",
4441
" - [Show files to commit](#toc5_1_) \n",
4542
" - [Preview changes](#toc5_2_) \n",
@@ -95,7 +92,7 @@
9592
},
9693
{
9794
"cell_type": "code",
98-
"execution_count": null,
95+
"execution_count": 1,
9996
"metadata": {},
10097
"outputs": [],
10198
"source": [
@@ -143,7 +140,7 @@
143140
"metadata": {},
144141
"outputs": [],
145142
"source": [
146-
"yc.get_yearly_releases(year)"
143+
"yc.get_yearly_releases(year);"
147144
]
148145
},
149146
{
@@ -152,7 +149,7 @@
152149
"source": [
153150
"<a id='toc3_'></a>\n",
154151
"\n",
155-
"## Creating the yearly folder "
152+
"## Rounding up the yearly releases"
156153
]
157154
},
158155
{
@@ -161,9 +158,9 @@
161158
"source": [
162159
"<a id='toc3_1_'></a>\n",
163160
"\n",
164-
"### Create the yearly folder \n",
161+
"### Retrieve the yearly folder \n",
165162
"\n",
166-
"The following cell creates a new subdirectory in `~site/releases/` based on your specified year."
163+
"The following cell locates the yearly subdirectory in `~site/releases/` based on your specified year so we can use the filepath in later functions."
167164
]
168165
},
169166
{
@@ -172,7 +169,7 @@
172169
"metadata": {},
173170
"outputs": [],
174171
"source": [
175-
"yearly_path = yc.create_year_folder(year)"
172+
"yearly_path = yc.retrieve_year_folder(year)"
176173
]
177174
},
178175
{
@@ -181,29 +178,11 @@
181178
"source": [
182179
"<a id='toc3_2_'></a>\n",
183180
"\n",
184-
"### Move releases into yearly folder \n",
185-
"\n",
186-
"Once we have the folder available, your matching release folders will get moved into this new yearly subdirectory."
187-
]
188-
},
189-
{
190-
"cell_type": "code",
191-
"execution_count": null,
192-
"metadata": {},
193-
"outputs": [],
194-
"source": [
195-
"yc.move_yearly_releases(yearly_path, yc.release_folders)"
196-
]
197-
},
198-
{
199-
"cell_type": "markdown",
200-
"metadata": {},
201-
"source": [
202-
"<a id='toc3_3_'></a>\n",
203-
"\n",
204181
"### Create yearly listing page \n",
205182
"\n",
206-
"This cell copies the template from `~internal/templates/yearly-releases.qmd` and slots it into the new yearly folder as `{year}-releases.qmd` so we can begin building the yearly listings."
183+
"This cell copies the template from `~internal/templates/yearly-releases.qmd` and slots it into the the yearly folder as `{year}-releases.qmd` so we can begin building the yearly listings.\n",
184+
"\n",
185+
"**It will also open up the newly created `{year}-releases.qmd` file for you so you don't have to go looking for it.**"
207186
]
208187
},
209188
{
@@ -219,7 +198,7 @@
219198
"cell_type": "markdown",
220199
"metadata": {},
221200
"source": [
222-
"<a id='toc3_4_'></a>\n",
201+
"<a id='toc3_3_'></a>\n",
223202
"\n",
224203
"### Edit the yearly listing page \n",
225204
"\n",
@@ -246,11 +225,11 @@
246225
"cell_type": "markdown",
247226
"metadata": {},
248227
"source": [
249-
"<a id='toc3_5_'></a>\n",
228+
"<a id='toc3_4_'></a>\n",
250229
"\n",
251-
"### Retrieve moved releases \n",
230+
"### Retrieve yearly release pages\n",
252231
"\n",
253-
"This cell returns the `release-notes.qmd` filepaths for all the release folders we just moved into the yearly subdirectory."
232+
"This cell returns the `release-notes.qmd` filepaths for all the release folders in our matching yearly subdirectory."
254233
]
255234
},
256235
{
@@ -266,11 +245,11 @@
266245
"cell_type": "markdown",
267246
"metadata": {},
268247
"source": [
269-
"<a id='toc3_6_'></a>\n",
248+
"<a id='toc3_5_'></a>\n",
270249
"\n",
271-
"### Add moved releases to listing page \n",
250+
"### Add releases to yearly listing page \n",
272251
"\n",
273-
"Next, we'll insert the moved release files into the listing for the yearly roundup page sorted by the release dates in descending order (newest first)."
252+
"Next, we'll insert that year's release pages into the listing for the yearly roundup page sorted by the release dates in descending order (newest first)."
274253
]
275254
},
276255
{
@@ -300,9 +279,9 @@
300279
"\n",
301280
"### Add yearly release folder to sidebar \n",
302281
"\n",
303-
"Since we moved our releases for the specified year into their own subfolder, we'll need to update the sidebar in `_quarto.yml` to accomodate.\n",
282+
"Now that we've created the yearly listing page, we need to update the sidebar in `_quarto.yml` to accomodate.\n",
304283
"\n",
305-
"**This cell takes all the release filepaths we just moved into our yearly folder and shoves them into a `contents:` accordion menu with the new `{year}-.releases.qmd` listing page as the landing page.** \n"
284+
"**This cell takes all the release filepaths matching our year and shoves them into a `contents:` accordion menu with the new `{year}-.releases.qmd` listing page as the landing page.** \n"
306285
]
307286
},
308287
{
@@ -334,48 +313,6 @@
334313
"yc.move_year_marker(year)"
335314
]
336315
},
337-
{
338-
"cell_type": "markdown",
339-
"metadata": {},
340-
"source": [
341-
"<a id='toc4_3_'></a>\n",
342-
"\n",
343-
"### Fix broken filepaths \n",
344-
"\n",
345-
"This cell looks for absolute filepaths in `.qmd` and `.yml` files in `~site/` matching `releases/{year}-` and renames them `releases/{year}/{year}-` to accomodate for the releases we moved."
346-
]
347-
},
348-
{
349-
"cell_type": "code",
350-
"execution_count": null,
351-
"metadata": {},
352-
"outputs": [],
353-
"source": [
354-
"yc.update_paths(year)"
355-
]
356-
},
357-
{
358-
"cell_type": "markdown",
359-
"metadata": {},
360-
"source": [
361-
"<a id='toc4_4_'></a>\n",
362-
"\n",
363-
"### Retrieve relative paths \n",
364-
"\n",
365-
"This cell looks for relative paths (`../example.qmd`) in the `~site/releases/` folder that might need manual adjustment, such as in listings or any links that don't follow our proper `/root` convention but should. \n",
366-
"\n",
367-
"**You will ned to review these links and edit them if necessary to ensure that the filepaths are not broken after the move.**"
368-
]
369-
},
370-
{
371-
"cell_type": "code",
372-
"execution_count": null,
373-
"metadata": {},
374-
"outputs": [],
375-
"source": [
376-
"yc.search_links(yearly_path)"
377-
]
378-
},
379316
{
380317
"cell_type": "markdown",
381318
"metadata": {},
@@ -449,10 +386,7 @@
449386
"**You may want to send a commit up to remote before you begin editing so you have a backup.**\n",
450387
"\n",
451388
"- [ ] Make sure that the new yearly accordion menu displays as expected in the sidebar under `About > Releases`.\n",
452-
"- [ ] Check in `_quarto.yml` that the `# CURRENT-YEAR-END-MARKER` was moved to above your rounded up releases for your specified year.\n",
453-
"- [ ] Double-check the files edited by `Fix broken filepaths` to ensure that the new links resolve correctly\n",
454-
"- [ ] Resolve any relative links found in `Retrieve relative paths` that were broken by the move. \n",
455-
"- [ ] Resolve any other links that might have been broken by the move by checking using `quarto render`. \n",
389+
"- [ ] Check in `_quarto.yml` that the `# CURRENT-YEAR-END-MARKER` was moved to above your rounded up releases for your specified year. \n",
456390
"- [ ] Review the summaries at the top of each release page to make sure they look good on the listing tiles.\n",
457391
"- [ ] Make sure any relevant files are committed to remote in preparation for your PR!"
458392
]

0 commit comments

Comments
 (0)