Skip to content

Fix workspace variable listing for unpaginated endpoints#183

Closed
kiwigitops wants to merge 1 commit into
hashicorp:mainfrom
kiwigitops:codex/variables-list-unpaginated
Closed

Fix workspace variable listing for unpaginated endpoints#183
kiwigitops wants to merge 1 commit into
hashicorp:mainfrom
kiwigitops:codex/variables-list-unpaginated

Conversation

@kiwigitops

Copy link
Copy Markdown

Summary

The workspace vars endpoints return all rows in a single response and do not include pagination metadata. Routing them through the generic paginated list helper can loop indefinitely when the workspace has at least 100 variables because every requested page returns the same full data set.

This changes variables.list and variables.list_all to issue one request to the workspace variable endpoints and map the returned rows directly.

Closes #181.

Tests

  • python -m pytest tests/units/test_variable.py -q -p no:cacheprovider
  • python -m ruff check src/pytfe/resources/variable.py tests/units/test_variable.py
  • python -m ruff format --check src/pytfe/resources/variable.py tests/units/test_variable.py
  • python -m mypy src/pytfe/resources/variable.py

@kiwigitops kiwigitops requested a review from a team as a code owner June 13, 2026 15:18
@iam404

iam404 commented Jun 15, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution. But the changes in this PR is superseded by merged PR #182 .
I am closing this PR for now, but do keep contributing for any future issue/features.

@iam404 iam404 closed this Jun 15, 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.

variables.list() infinite-loops on workspaces with ≥100 variables (the /vars endpoint is not paginated)

2 participants