Skip to content

Retry, edit, status and header fixes, release 0.3.0 - #23

Merged
mjstealey merged 5 commits into
mainfrom
review-fixes
Oct 22, 2026
Merged

mjstealey merged 5 commits into
mainfrom
review-fixes

Conversation

@mjstealey

Copy link
Copy Markdown
Member

Summary

Fixes from a review of the client, one commit each, plus the 0.3.0 release bump.

  • Don't retry POST (7397a21). POST is not idempotent; a retry after the server created the record but returned 5xx could duplicate it (e.g. cous_add, coperson_roles_add). GET, PUT and DELETE still retry.
  • Edits can clear fields (f40b38d). cous_edit, coperson_roles_edit and ssh_keys_edit keep the existing value only for None, so '' now clears a description or comment instead of being silently ignored. An empty status, affiliation or key_type now raises ValueError.
  • Case-insensitive status (aabf319). CoPersonRole status is normalized to COmanage's canonical form ('active' -> 'Active'), matching how affiliation and key type are handled.
  • Keep default session headers (c3c0d10). headers.update() instead of replacing the dict, so User-Agent, Accept-Encoding and Accept are sent again.

The first two change caller-visible behavior, hence 0.3.0 rather than 0.2.4.

Verification

  • pytest: 145 passed (7 new tests); ruff check: clean
  • Smoke tested through the real requests/urllib3 stack against a local fake COmanage server: POST sent once vs. GET retried 3x on 500; description/comment cleared via edit; status normalized on add and edit; default headers present on the wire.
  • Not live-tested: the alpha registry (registry-test.cilogon.org) currently serves a certificate for test.cilogon.org only, so TLS verification fails.

After merge, push tag v0.3.0 to publish to PyPI.

🤖 Generated with Claude Code

mjstealey and others added 5 commits October 21, 2026 20:14
POST is not idempotent. Retrying a POST that the server processed but
answered with a 5xx could create duplicate records (e.g. cous_add,
coperson_roles_add). Retries remain for GET, PUT and DELETE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cous_edit, coperson_roles_edit and ssh_keys_edit now treat only None as
"keep the existing value". Previously any falsy argument ('' or 0) was
silently ignored, so a description or comment could not be cleared.
An empty status, affiliation or key_type now fails validation instead
of being dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coperson_roles_add and coperson_roles_edit now accept status in any
case and send COmanage's canonical spelling ('active' -> 'Active'),
consistent with how affiliation and SSH key type are already handled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use headers.update() to add Content-Type instead of replacing the
session headers dict, which dropped User-Agent, Accept-Encoding and
Accept from every request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bump version and add CHANGELOG entry for the retry, edit, status and
header fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mjstealey
mjstealey merged commit e1983b2 into main Oct 22, 2026
11 checks passed
@mjstealey
mjstealey deleted the review-fixes branch October 22, 2026 01:15
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.

1 participant