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

[DOC] Improve NEWS.md rendering and add missing features #9308

Merged
merged 3 commits into from Dec 21, 2023

Conversation

zverok
Copy link
Contributor

@zverok zverok commented Dec 20, 2023

  • Fix rendering of the file on docs.ruby-lang.org:
    • More indentation for code;
    • Properly qualified methods to link to docs (Queue#freezeThread::Queue#freeze, remove unnecessary backticks, etc.)
  • Add two minor yet notable changes:
    • Time.new stricter parsing of strings;
    • NoMethodError rendering logic change.

@zverok zverok added the Documentation Improvements to documentation. label Dec 20, 2023
@zverok zverok self-assigned this Dec 20, 2023
Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

Looks mostly good. Only a couple changes requested.

NEWS.md Outdated
@@ -67,6 +68,16 @@ Note: We're only listing outstanding class updates.
* Module#set_temporary_name added for setting a temporary name for a
module. [[Feature #19521]]

* NoMethodError
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this change is worth mentioning in NEWS.

Copy link
Member

Choose a reason for hiding this comment

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

I think it is better to explain this in "Compatibility issues" section than in "Core classes updates".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeremyevans My thinking here is this:

  1. It is a part of public behavior
  2. It is a behavior that is frequently encountered (i.e., almost every Rubyist sees this error almost every day, while some other notable changes like WeakKeyMap or Fiber#kill are something that wouldn't be used by as many people)
  3. The change affects the quality of life. I understand the justification, yet the change might make somebody's debugging harder (by not seeing the real problematic object) and somebody's easier (by removing 20-lines #inspects of complicated objects)
  4. The change also might affect application/library code (this is purely theoretical, but not unimaginable that some code caught the error and extracted the #inspect of the affected object; or that somebody's #inspect was defined in the way that considered frequent rendering in this message)
  5. The entry in NEWS not only explains the change but links to the corresponding discussion, so when one sees in the new version, "wait, is this changed?" they can a) find the entry in NEWS (and make sure the change was conscious, not some side-effect or bug) and b) find the justification.

Copy link
Contributor

Choose a reason for hiding this comment

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

@zverok I read what you wrote and still do not think this is worth mentioning. There is a tradeoff in mentioning anything in NEWS. We want NEWS to be short enough that people will read it, hitting the important parts of the release. NEWS is not designed to be comprehensive and discuss every single change since the last release. If you think this is a compatibility issue (I do not), take @mame's advice and put it in the compatibility issues section. Otherwise, I think it should be removed.

Copy link
Member

Choose a reason for hiding this comment

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

I'm for because it is a part of public behavior.
Generally speaking NEWS.md is allowed to write about something if a committer thinks it should be.
I think what jeremy says is rather a release note.

NEWS.md Outdated
@@ -488,3 +510,5 @@ changelog for details of the default gems or bundled gems.
[Feature #19965]: https://bugs.ruby-lang.org/issues/19965
[Feature #20005]: https://bugs.ruby-lang.org/issues/20005
[Feature #20057]: https://bugs.ruby-lang.org/issues/20057
[Bug #19293]: https://bugs.ruby-lang.org/issues/19293
[Feature #18285]: https://bugs.ruby-lang.org/issues/18285
Copy link
Contributor

Choose a reason for hiding this comment

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

When removing the NoMethodError change, we would want to remove this line as well.

Copy link
Member

Choose a reason for hiding this comment

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

It's better to sort by URLs.

@@ -75,7 +86,7 @@ Note: We're only listing outstanding class updates.

* ObjectSpace::WeakMap

* `ObjectSpace::WeakMap#delete` was added to eagerly clear weak map
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you remove backquote even though it is .md?

Copy link
Member

Choose a reason for hiding this comment

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

It will be marked up as <code> without backquotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ko1 Without backticks RDoc is able to linkify the method name.
The current version:
image
After the fix:
image

Copy link
Contributor

@ko1 ko1 Dec 21, 2023

Choose a reason for hiding this comment

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

I see.


For me, it is better to allow backquotes and rdoc also accepts backquoted method names in future, because it is easy to copy & paste to other articles.

Copy link
Member

Choose a reason for hiding this comment

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

You mean the case of "only method name enclosed in backquotes", right?
E.g., `ObjectSpace::WeakMap#delete`, but not `(ObjectSpace::WeakMap#delete)`.
It would be better but should be requested to ruby/rdoc, not here.

* Fix rendering of Ruby examples by RDoc;
* Fix links to methods references;
* Add missing minor changes.
Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

One additional change requested. After that, OK to merge without further review.

NEWS.md Outdated
```ruby
Time.new('2023-12-20')
# no time information (ArgumentError)
Time.new('2023-12-20')
Copy link
Contributor

Choose a reason for hiding this comment

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

This uses the same code twice, which doesn't appear intentional. I would remove the duplicate lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh. Meant to show "year-month" and "year-month-day", it is a typo. But anyway, I think one example is enough.

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

I did mention in my previous review that this could be merged without further review after the change I requested was made.

Please squash when merging.

@zverok zverok merged commit fc549b2 into ruby:master Dec 21, 2023
15 checks passed
@zverok zverok deleted the news-missing-features branch December 21, 2023 21:12
@nurse nurse mentioned this pull request Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
6 participants