changelog: validate rst entry line lengths - #4834
Conversation
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@dio thanks for this, will look shortly - other pipelines are taking longer to resolve than i hoped, and i have some python stuff that needs testing already so will look at this when i get to py stuff |
|
Gentle ping @phlax, whenever you have a chance to take a look. Thanks! |
|
yeah apologies - will look soon - i had to clear bzlmod first, and now just doing some follow/clean ups |
|
... fwiw i had intended to look at the (python) release stuff prior to the last sec/patch release, but just didnt find the time - my deadline now is the release in a month - but will hopefully get to this sooner |
|
k finally have some time to look at the python stuff - fwiw - the blocker was #5224 i tested this pr - and the problem we have - yamllint allows for unbroken lines so eg this is picked up, but should be allowed 1 The downstream reverse-tunnel initiator
2 (``envoy.bootstrap.reverse_tunnel.downstream_socket_interface``) now accepts
3 :ref:`maintain_interval <envoy_v3_api_field_extensions.bootstrap.reverse_tunnel.downstream_socket_interface.v3.DownstreamReverseConnectionSocketInterface.maintain_interval>`
4 to control how often each host is re-checked and missing tunnels are dialed.
5 Unset keeps the historical 10s default. The existing 15% upward jitter still
6 applies. The minimum allowed value is 100ms.trying to think how we can accomodate that |
|
actually i needed this to make it pass yamllint --- a/changelogs/current/new_features/reverse_tunnel__maintain-interval.rst
+++ b/changelogs/current/new_features/reverse_tunnel__maintain-interval.rst
@@ -1,6 +1,7 @@
The downstream reverse-tunnel initiator
(``envoy.bootstrap.reverse_tunnel.downstream_socket_interface``) now accepts
-:ref:`maintain_interval <envoy_v3_api_field_extensions.bootstrap.reverse_tunnel.downstream_socket_interface.v3.DownstreamReverseConnectionSocketInterface.maintain_interval>`
+:ref:`maintain_interval
+<envoy_v3_api_field_extensions.bootstrap.reverse_tunnel.downstream_socket_interface.v3.DownstreamReverseConnectionSocketInterface.maintain_interval>`
to control how often each host is re-checked and missing tunnels are dialed.
Unset keeps the historical 10s default. The existing 15% upward jitter still
applies. The minimum allowed value is |
|
(argh apologies - did not mean to close this) so i think we will need to use yamllint directly to do the length check - not sure why but this wasnt properly handling unbroken lines the same way as yamllint does botsplanation ... Suggest we make yamllint the source of truth and just lint the entry as it will appear in the yaml — indented under the from yamllint import config as yamllint_config, linter as yamllint_linter
# Indent of an entry inside the `change: |` block scalar
YAML_ENTRY_INDENT = " "
def check_entry_line_lengths(
self,
path: pathlib.Path) -> tuple[str, ...]:
content = "".join(
f"{YAML_ENTRY_INDENT}{line}\n"
for line
in path.read_text().splitlines())
return tuple(
f"{path}:{problem.line}: {problem.desc}"
for problem
in yamllint_linter.run(content, self.yamllint_config)
if problem.rule == "line-length")with That gives identical semantics by construction — including the non-breakable-word exemption, the 140 max, and anything we change in |
picked from envoyproxy#4834 Signed-off-by: Ryan Northey <ryan@synca.io>
|
this also has a fix for the changelog categories - picked that so we can land it immediately |
picked from #4834 Signed-off-by: Ryan Northey <ryan@synca.io>
Summary
current_dir_pathand removing the obsoleteentries_layoutcheckRationale
Envoy limits YAML lines to 140 characters. Changelog entries are emitted as YAML block scalars with four spaces of indentation, so source RST lines must be at most 136 characters. This is validation-only: automatically wrapping RST roles, links, lists, or literal blocks could change their meaning.
Testing
pants fmt py/envoy.code.check::pants lint py/envoy.code.check::pants check py/envoy.code.check::pants test py/envoy.code.check::envoy.code.check --check changelogagainst an Envoy checkout, confirming overlong entries fail and wrapped entries passFollow-up
After this change is released, an Envoy follow-up will update the
envoy-code-checkdependency, wrap the existing overlong RST entries, and runbazel test //tools/code:check_test. That follow-up will complete envoyproxy/envoy#46148.Part of envoyproxy/envoy#46148.
AI assistance was used to analyze the code, implement the change, and prepare tests. The submitter reviewed and verified the resulting changes.