Skip to content

Commit 7b7652d

Browse files
authored
Merge pull request #184 from hashicorp/release-1.1.0
Release 1.1.0: update changelog + bump version and minor change
2 parents 312b4d5 + 502634c commit 7b7652d

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Unreleased
2+
3+
# Released
24
# v1.1.0
35

46
## Features
@@ -28,8 +30,13 @@
2830
### Pagination
2931
* Fixed `list_*` infinite-looping for API call which are non paginated, so they are now fetched with a single request. The generic list helper also treats any response without `meta.pagination` as a single complete page, preventing the same loop on other non-paginated endpoints. [#181](https://github.com/hashicorp/python-tfe/issues/181)
3032

33+
### Relationships
34+
* Unified JSON:API relationship parsing into a single canonical helper, replacing the per-resource hand-rolled logic across runs, workspaces, no-code modules and more. [#180](https://github.com/hashicorp/python-tfe/pull/180)
35+
* `?include=`'d relations are now fully hydrated from the response's `included` block (e.g. `workspace.current_run.status`) instead of being returned as id-only stubs.
36+
* Models retain unknown server attributes in `model_extra` (`extra="allow"`) instead of silently dropping them, keeping output closer to the live API.
37+
* Added missing `Workspace` fields `latest_run`, `latest_change_at`, `last_assessment_result_at`, and `source_module_id`, which previously raised `AttributeError`. [#179](https://github.com/hashicorp/python-tfe/issues/179)
38+
3139

32-
# Released
3340
# v1.0.0
3441

3542
## Features

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "pytfe"
7-
version = "1.0.0"
7+
version = "1.1.0"
88
description = "Official Python SDK for HashiCorp Terraform Cloud / Terraform Enterprise (TFE) API v2"
99
readme = "README.md"
1010
license = { text = "MPL-2.0" }

src/pytfe/models/workspace.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ class Workspace(BaseModel):
171171
source: WorkspaceSource | None = Field(None, alias="source")
172172
source_name: str | None = Field(None, alias="source-name")
173173
source_url: str | None = Field(None, alias="source-url")
174+
# ID of the registry module a no-code workspace was provisioned from (#179).
175+
source_module_id: str | None = Field(None, alias="source-module-id")
174176
structured_run_output_enabled: bool | None = Field(
175177
None, alias="structured-run-output-enabled"
176178
)

tests/units/test_workspace_jsonapi.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ def test_new_attributes_parse_with_correct_types(self):
3737
# aliased KPI field still maps despite the divergent snake/hyphen names
3838
assert ws.runs_count == 3
3939

40+
def test_source_module_id_parses_for_no_code_workspace(self):
41+
# #179: no-code workspaces carry source-module-id; it must be a typed
42+
# attribute, not buried in model_extra under the hyphenated wire key.
43+
ws = _ws_from(_ws_payload(attributes={"source-module-id": "mod-ABC123"}))
44+
assert ws.source_module_id == "mod-ABC123"
45+
assert "source-module-id" not in (ws.model_extra or {})
46+
# absent on a normal workspace -> None, never an error
47+
assert _ws_from(_ws_payload()).source_module_id is None
48+
4049

4150
class TestForwardCompat:
4251
def test_unknown_attribute_survives_in_model_extra(self):

0 commit comments

Comments
 (0)