-
Notifications
You must be signed in to change notification settings - Fork 40
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
fix: Update Support Window spreadsheet #414
Conversation
Thanks for the pull request, @MimmyJau! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
I notice there are some commit-lint failures. Please note that we use conventional commits across Open edX projects. You can read about the details here. Can you please amend your commit messages to follow our standard? |
Thanks @e0d! I noticed I made that mistake but was a little cautious to force push an updated git history. With your permission I'll go ahead and make those changes. |
No worries, you can force push in this case. |
465134d
to
1c33cc1
Compare
barcalendar.py
Outdated
Get openedx version name in line from YAML file. | ||
e.g. "open-release/palm.1" -> "Palm" | ||
""" | ||
match = re.search(r'(?P<version_name>[A-Za-z]+)[\.\d+]*$', line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how this setting is managed. Sometimes its value is open-release/palm.master
. Perhaps the best approach is to use:
match = re.search(r'/(?P<version_name>[A-Za-z]+)\.', line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified it to
match = re.search(r'(?P<version_name>[A-Za-z]+)(\.\w*)*$', line)
to also match the following cases:
"open-release/palm.1"
"open-release/palm.1.2.3"
"open-release/palm.master"
"open-release/palm.master.1.2.3"
"open-release/palm."
It is a bit redundant. Looking at this page, it shouldn't deviate from the two formats we considered here.
Happy to go with the simpler approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, it's simpler to say, "the word between the slash and the dot." Your regex is, "the word followed by dots and words at the end of the line," which seems more confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you phrase it that way, I completely agree. I've made the change.
barcalendar.py
Outdated
|
||
if resp.status_code == 200: | ||
return safe_load(resp.text) | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For many of the info functions, it would be better to raise an exception than to return None. If a problem occurs, and they return None, we'll have a mysterious error elsewhere in the program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a raise RuntimeError
if resp.status_code
is anything but 200
.
Also in the except
block above, I re-raised the RequestException
error. Let me know if this makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requests has a helper method: https://requests.readthedocs.io/en/latest/api/#requests.Response.raise_for_status . It will raise an exception based on the status code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, did not know about this. I've incorporated it.
See here for original comment: openedx#414 (comment) Version name might be something like "palm.master", in which case we don't just want to capture a version number.
Was previously importing a specific function but this was not consistent with style. See here for original comment: openedx#414 (comment)
Before, if http request to tutor's defaults.yml returned status code != 200, function would return None and continue. No error would be raised. This fix now raises a RuntimError. See here for original comment: openedx#414 (comment)
f-string is unnecessary if the string is a single Python expression. Replaced f-string with just the expression where possible. See here for original comment: openedx#414 (comment)
Hi @nedbat! Would you please re-run the tests, as they bounced back to needing approval. |
barcalendar.py
Outdated
if match is not None: | ||
version_number = match.group("version_number") | ||
return version_number | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to raise an exception if the version number can't be found. If it's missing, then no error happens, and the chart is made with no version highlighted as current. Maybe something like:
return None | |
raise ValueError(f"Couldn't get version from {line!r}") |
and something similar for parse_version_name
also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense and I agree. The latest commit adds this and also an exception for the related function parse_version_name
.
Sorry for all the tweaks, thanks for pushing through with this. BTW, I have to ask: what drew your attention to this program? It's off the beaten path, so to speak! 😄 |
Add support date for Elasticsearch version 7.17. Did not include support dates for previous versions between 7.14 and 7.16 inclusive.
Add functions for automatically pulling version number from tutor's default config file and choosing which bars to bold and outline. This pulls the name and / or number for the current version of openedx, MongoDB, Elasticsearch, MySQL, and Redis. It does not pull the current version of Python, Django, Ubuntu, Node, or Ruby. To be clear, this commit doesn't add new bars to the calendar, it only automates how we choose which bars to bold and outline. For example, if we were to switch to Elasticsearch 8.x.x, we'll still need to manually add the release and EOL dates.
See here for original comment: openedx#414 (comment) Version name might be something like "palm.master", in which case we don't just want to capture a version number.
Was previously importing a specific function but this was not consistent with style. See here for original comment: openedx#414 (comment)
Before, if http request to tutor's defaults.yml returned status code != 200, function would return None and continue. No error would be raised. This fix now raises a RuntimError. See here for original comment: openedx#414 (comment)
f-string is unnecessary if the string is a single Python expression. Replaced f-string with just the expression where possible. See here for original comment: openedx#414 (comment)
d402ab2
to
9b46aff
Compare
Co-authored-by: Ned Batchelder <[email protected]>
Before, if version name or number wasn't found, will continue to run program and generate a bar calendar that doesn't have bolded bars. Want to instead raise an error. See here for original comment: openedx#414 (comment)
Not a problem at all! Thanks for taking the time and attention. I came across the issue here. Saw that it was backlogged and at the top. It also looked like a good first issue so I figured why not :) |
@MimmyJau 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Note: There are two commits. The first commit adds the release date and EOL dates for the current ElasticSearch 7.17 version. The second commit adds functionality for auto-updating some of the version numbers based on
Tutor
defaults.Background: Based on the notes in this issue. Current Support Windows spreadsheet is not up-to-date. Noticed there hasn't been any attempt to add these features, so this is a first pass at trying to update
barcalendar.py
.Doesn't include:
Happy to make any changes based on feedback. Thanks in advance.