Skip to content

Stop doubling the trailing bang in email headers; restore Globus error limit - #128

Merged
zaihuaji merged 1 commit into
mainfrom
hua-work-common
Sep 30, 2026
Merged

zaihuaji merged 1 commit into
mainfrom
hua-work-common

Conversation

@zaihuaji

Copy link
Copy Markdown
Collaborator

Summary

  • pg_log.py: set_email appended its own ! to an EMLTOP message that already ended with one, producing ...0 tarred!! in dsquasar progress reports. The bang is now added only when the caller left it off, and the caller's bang is dropped before the sentence continues with with N Errors: (so the header reads ...of All datasets with 6 Errors: rather than ...datasets! with 6 Errors:).
  • pg_file.py: ELMTS['B'] back to 5. A failed Globus transfer used to be logged twice, so the limit of 10 gave up after 5 failures; 3.0.19 made it one error per failure, which silently doubled the tolerance.

Test plan

  • ast.parse clean on both modules
  • Header rendering checked for all four cases: caller-with-bang, caller-without, error and no-error branches, already-newline-terminated
  • Confirm the next dsquasar progress email ends with a single !

…us error limit; bump version to 3.0.20

pg_log.py: set_email appended its own '!' to an EMLTOP message that already
ended with one, giving the '...0 tarred!!' seen in dsquasar reports. It now
adds the bang only when the caller left it off, and drops the caller's bang
before continuing the sentence with ' with N Errors:'.

pg_file.py: ELMTS['B'] back to 5. A failed Globus transfer used to be logged
twice, so the limit of 10 gave up after 5 failures; 3.0.19 made it one error
per failure, which had silently doubled the tolerance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 14:08
@zaihuaji
zaihuaji merged commit 194dcb8 into main Sep 30, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Newline-terminated error headers and the legacy email API remain unfixed, while some Globus failures still count twice against the lower limit.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

This PR updates email-header formatting and restores the intended Globus failure limit for a 3.0.20 release.

Changes:

  • Avoid adding a second ! to class-based email headers.
  • Lower the Globus error limit from 10 to 5.
  • Update the package version and README example.
File Description
src/​rda_python_common/​pg_log.py Changes top-level email-header formatting.
src/​rda_python_common/​pg_file.py Lowers the Globus error limit.
src/​rda_python_common/​__init__.py Updates the package version.
README.md Updates the documented version.
pyproject.toml Updates the distribution version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

self.ELMTS = {'D': 20, 'H': 20, 'L': 20, 'R': 20, 'O': 10, 'B': 10}
# 'B' is 5 because a failed Globus transfer counts once; it used to be logged
# twice per failure, so the old limit of 10 also gave up after 5 failures
self.ELMTS = {'D': 20, 'H': 20, 'L': 20, 'R': 20, 'O': 10, 'B': 5}
Comment on lines +255 to +256
if not msg.endswith('\n'):
msg += "\n" if msg.endswith('!') else "!\n"
if not msg.endswith('\n'):
msg += "\n" if msg.endswith('!') else "!\n"
else:
if msg.endswith('!'): msg = msg[:-1]
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.

2 participants