Copilot commented on code in PR #51117:
URL: https://github.com/apache/arrow/pull/51117#discussion_r3900193805
##########
dev/archery/archery/release/core.py:
##########
@@ -136,6 +136,11 @@ def project_issues(self, version):
issues = self.github_repo.get_issues(
milestone=self._milestone_from_semver(version),
state="all")
+ # This is only for testing. We can limit the number of issues
+ # to be processed for faster testing.
+ max_issues = os.environ.get("ARCHERY_MAX_PROJECT_ISSUES")
+ if max_issues is not None:
+ issues = issues[:int(max_issues)]
return list(map(Issue.from_github, issues))
Review Comment:
`ARCHERY_MAX_PROJECT_ISSUES` is read from the environment and immediately
cast with `int(max_issues)`. If the variable is set to a non-integer value (or
a negative), `archery` will crash with `ValueError` even outside tests.
Consider parsing defensively and ignoring invalid values, and (optionally)
converting `issues` to a list before slicing to avoid relying on PaginatedList
slice semantics.
##########
dev/release/post-10-bump-versions-test.rb:
##########
@@ -480,4 +482,53 @@ def test_linux_packages
parse_patch(git("log", "-n", "1", "-p")),
"Output:\n#{stdout}")
end
+
+ def normalized_time
+ "1970-01-01 00:00:00+00:00"
+ end
+
+ def normalize_time(string)
+ string.gsub(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2}/) do
+ normalized_time
+ end
+ end
Review Comment:
`normalize_time` assumes `string` is non-nil. If the patch has no added
lines for any reason (e.g., changelog generation fails and produces no diff),
the test will error with `NoMethodError` instead of failing the assertion with
useful output. Guard against `nil` and return `nil` unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]