Skip to content

CBG-5715: add x-enumDescriptions to enums that only listed values - #8653

Open
torcolvin wants to merge 2 commits into
CBG-5715-04-integer-typesfrom
CBG-5715-05-enum-descriptions
Open

CBG-5715: add x-enumDescriptions to enums that only listed values#8653
torcolvin wants to merge 2 commits into
CBG-5715-04-integer-typesfrom
CBG-5715-05-enum-descriptions

Conversation

@torcolvin

@torcolvin torcolvin commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

CBG-5715

Split out of #8589 — stack 5/9, based on #8652.

These enums rendered as a bare list of allowed values, leaving the reader to guess what each one does. Document each value using the same x-enumDescriptions extension already used elsewhere in the specs:

  • _compact?type, _profile/{name}, _sgcollect_info redact_level
  • _replicationStatus/{id} action
  • _changes style, filter and feed (public and admin)
  • resync, attachment migration and metadata migration status
  • logging redaction_level, unsupported session_cookie_samesite

Also fixes six pre-existing uses of the singular x-enumDescription on the audit logging domain fields. Redocly only recognises the plural form, so those cbs/sgw descriptions were being silently dropped.

Compact-status.phase is deliberately left out: its enum is currently attached to the wrong property, which is the next PR in the stack.

Both of @bbrks' description comments on #8589 are incorporated here:

  • _sgcollect_info redaction: none is the default, not partial (tools/sgcollect.py:150--log-redaction-level default="none").
  • longpoll is one-shot: changes_api.go:346 sets options.Wait = true and calls the same sendSimpleChanges path as normal, so it sends a single response.

Other factual claims verified: redaction full and unset both fall through SetRedaction to RedactUserData = true, i.e. they behave as partial; same_site_cookie: Default omits the attribute (auth/session.go:192); reset requires a stopped replication (db/sg_replicate_cfg.go:444).

Pre-review checklist

  • Logging sensitive data? N/A — docs only
  • Updated relevant information in the API specifications in docs/api

🤖 Generated with Claude Code

@factory-droid

factory-droid Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Droid finished @torcolvin's task —— View job


The added enum descriptions are a solid documentation improvement, but there are a couple of concrete accuracy issues to correct (a contradictory “Default” label for redact_level, and a sync_gateway/bychannels typo that documents an invalid filter value).

Comment thread docs/api/paths/admin/_sgcollect_info.yaml
Comment thread docs/api/paths/admin/keyspace-_changes.yaml
Comment thread docs/api/paths/public/keyspace-_changes.yaml
torcolvin added a commit that referenced this pull request Aug 23, 2026
Review follow-ups on #8653:

- `_sgcollect_info` `redact_level` declared `default: partial`, which
  contradicts the implementation. `rest/sgcollect.go:389` only passes
  `--log-redaction-level` when the field is set, and `tools/sgcollect.py:150`
  defaults that option to `none`, so omitting `redact_level` collects
  unredacted logs.

- Four `channels` descriptions in the public and admin `_changes` specs
  referred to the filter as `sync_gateway/bychannels`, which is not a valid
  value. `base.ByChannelFilter` is `sync_gateway/bychannel`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin requested review from a team and a lite review from Copilot August 23, 2026 18:22
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

Redocly previews

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.

Pull request overview

Improves the Sync Gateway OpenAPI documentation in docs/api/ by adding x-enumDescriptions to previously under-documented enums (which otherwise render as unannotated value lists), and by correcting a few enum-related documentation issues so Redocly renders the intended descriptions.

Changes:

  • Add x-enumDescriptions for _changes enums (style/filter/feed) in both public and admin specs, and fix the sync_gateway/bychannel reference in the channels parameter description.
  • Add x-enumDescriptions for replication control action (start|stop|reset), _profile/{name} profile types, and _sgcollect_info redact_level (also correcting its documented default to none).
  • Replace pre-existing x-enumDescription (singular) with x-enumDescriptions (plural) for audit logging domain enums, and add enum descriptions for several other schemas (e.g., same_site_cookie, migration/resync statuses, logging redaction level).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/api/paths/public/keyspace-_changes.yaml Documents public _changes enum values (style/filter/feed) via x-enumDescriptions and corrects the bychannel filter reference.
docs/api/paths/admin/keyspace-_changes.yaml Mirrors the public _changes enum documentation and bychannel reference fix for the admin endpoint.
docs/api/paths/admin/db-_replicationStatus-replicationid.yaml Adds x-enumDescriptions for replication action query parameter values.
docs/api/paths/admin/_sgcollect_info.yaml Corrects redact_level default and documents enum meanings with x-enumDescriptions.
docs/api/paths/admin/_profile-profilename.yaml Adds descriptions for supported profile name enum values.
docs/api/components/schemas.yaml Fixes audit logging enum extension name and adds enum descriptions for SameSite, migration/resync statuses, and logging redaction level.
docs/api/components/parameters.yaml Adds enum descriptions for the compaction type parameter values.

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

torcolvin added a commit that referenced this pull request Aug 24, 2026
Review follow-ups on #8653:

- `_sgcollect_info` `redact_level` declared `default: partial`, which
  contradicts the implementation. `rest/sgcollect.go:389` only passes
  `--log-redaction-level` when the field is set, and `tools/sgcollect.py:150`
  defaults that option to `none`, so omitting `redact_level` collects
  unredacted logs.

- Four `channels` descriptions in the public and admin `_changes` specs
  referred to the filter as `sync_gateway/bychannels`, which is not a valid
  value. `base.ByChannelFilter` is `sync_gateway/bychannel`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin force-pushed the CBG-5715-05-enum-descriptions branch from 83f1e9f to c22f5bd Compare August 24, 2026 17:10
torcolvin and others added 2 commits August 24, 2026 13:42
These enums rendered as a bare list of allowed values, leaving the reader
to guess what each one does. Document each value using the same
`x-enumDescriptions` extension already used elsewhere in the specs:

- `_compact?type`, `_profile/{name}`, `_sgcollect_info` redact_level
- `_replicationStatus/{id}` action
- `_changes` style, filter and feed (public and admin)
- resync, attachment migration and metadata migration status
- logging redaction_level, unsupported session_cookie_samesite

Also fix six pre-existing uses of the singular `x-enumDescription` on the
audit logging `domain` fields. Redocly only recognises the plural form,
so the cbs/sgw descriptions were being silently dropped.

`Compact-status.phase` is deliberately left out: its enum is currently
attached to the wrong property, which is a separate fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review follow-ups on #8653:

- `_sgcollect_info` `redact_level` declared `default: partial`, which
  contradicts the implementation. `rest/sgcollect.go:389` only passes
  `--log-redaction-level` when the field is set, and `tools/sgcollect.py:150`
  defaults that option to `none`, so omitting `redact_level` collects
  unredacted logs.

- Four `channels` descriptions in the public and admin `_changes` specs
  referred to the filter as `sync_gateway/bychannels`, which is not a valid
  value. `base.ByChannelFilter` is `sync_gateway/bychannel`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin force-pushed the CBG-5715-05-enum-descriptions branch from c22f5bd to 74fa0b7 Compare August 24, 2026 17:42
@torcolvin
torcolvin requested a review from bbrks August 24, 2026 17:46
@bbrks bbrks removed their assignment Aug 25, 2026
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.

3 participants