Skip to content

Conversation

@bhargav-j47
Copy link

@bhargav-j47 bhargav-j47 commented Nov 8, 2025

this PR adds feature #2297, fixes #2297

PR introduces following changes:
Automates the generation of the release roadmap SVG using a Python script and json.
changes download page from release-roadmap.png to release-roadmap.svg

Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! This is really strong

I have added some suggestions to make it easier to generate future svgs and how to make the generated image a little closer to the existing image

I think once we're happy with the generated image, we might want to consider writing a few tests

@bhargav-j47
Copy link
Author

Hi , thank you for the review . I have added suggested changes , please do let me know if anything needs to be added

Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

I have suggested changes which would end up generating the following image

image

After commiting suggestions you will need to update the current image committed by re-running the command.
A nice to have would be if we can end the graph one line earlier and add a fade out 🤔
We still have some minor discrepancies but I think it's "close enough"

@bhargav-j47
Copy link
Author

bhargav-j47 commented Nov 19, 2025

commited the suggested changes
-added fade at last of graph
-graph now ends one line earlier
-done changes to match the style of svg with old png

with changes release-roadmap.svg looks like this
release-roadmap

Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

Thank you for the updates @bhargav-j47 !

If we can have the "April", "August", "December" labels on being on the lines as in the original image, I think that would be amazing ✨

I think this is ready for a review from the website WG 👍

@sarahboyce sarahboyce requested a review from a team November 19, 2025 16:13
Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

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

Just realized the LTS extended support is all about 8 months too short, can you update (also update the svg)?

bhargav-j47 and others added 4 commits November 19, 2025 22:24
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Comment on lines 33 to 35
OUTPUT_FILE = os.path.join(
BASE_DIR, "..", "djangoproject", "static", "img", "release-roadmap.svg"
)
Copy link
Member

Choose a reason for hiding this comment

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

Minor: Can we use pathlib.Path for all path manipulations in this file? This would let us use OUTPUT_file.write_text(...) later on.

Comment on lines 161 to 165
def add_months(date: dtime.date, months: int) -> dtime.date:
year = date.year + (date.month - 1 + months) // 12
month = (date.month - 1 + months) % 12 + 1
day = min(date.day, calendar.monthrange(year, month)[1])
return dtime.date(year, month, day)
Copy link
Member

Choose a reason for hiding this comment

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

Minor: It seems that we already pull python-dateutil as a dependency somehow (looking at pip freeze | grep dateutil), so we could add it to our requirements file explicitly and use it here:

from dateutil.relativedelta import relativedelta
release_date + relativedelta(months=8)

"--first-release", required=True, help="First release number, e.g., 4.2"
)
parser.add_argument(
"--date", required=True, help="Release date in YYYY-MM format, e.g., 2023-04"
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: You could use argparse's type parameter to have this automatically be converted to a date object: https://docs.python.org/3/library/argparse.html#type

Copy link
Member

@bmispelon bmispelon left a comment

Choose a reason for hiding this comment

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

I clicked the wrong button and left individual comments rather than a review 🤦🏻

I left a few suggestions, some stronger than others (the content type issue for the og_image should really be fixed, the others are optional).

I also noticed two visual differences with the previous png image, not sure if it's been discussed already but I thought I'd point them out:

  • The legend texts ("Mainstream support" and "Extended support") are not centered anymore, they seem to be left-aligned
  • The month names are now horizontal instead of vertical as they were before, was that intentional?

Finally, in terms of code layout I'm a bit wary about adding a new tools directory. Could we make this a management command inside the existing releases app?

Thanks again for your work! 🎸

@bhargav-j47
Copy link
Author

bhargav-j47 commented Nov 20, 2025

i have commit suggested changes

  • created og_image_type that defaults to img/png but can override to use svg
  • using pathlib.Path for paths
  • using relativedelta instead of custom add months function
  • centered legend text
  • month lables now look exactly like original png

i have also added svg generation as management command in releases app with usage "python -m manage generate_release_roadmap --first release --date
if these changes are approved , tools directory can be removed completely

@sarahboyce
Copy link
Contributor

Tested the management command - looks good to me! Please remove the tools directory 👍

Copy link
Member

@bmispelon bmispelon left a comment

Choose a reason for hiding this comment

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

I've tested the management command and it works well. As Sarah pointed out, you can remove the tools directory now.

I've also left a small suggestion to simplify the use of OUTPUT_FILE now that it's a Path object.

Thanks again for working on this! 🎸

Comment on lines 339 to 340
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
f.write(output_svg)
Copy link
Member

Choose a reason for hiding this comment

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

Now that OUTPUT_FILE is a Path object, this can be replaced with:

Suggested change
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
f.write(output_svg)
OUTPUT_FILE.write_text(output_svg)

https://docs.python.org/3/library/pathlib.html#pathlib.Path.write_text

Copy link
Author

Choose a reason for hiding this comment

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

removed tools directory and done suggested changes

@bhargav-j47
Copy link
Author

i have done suggested changes please check if any more changes are needed

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.

Generate the release roadmap image

4 participants