Added nested global fields support#95
Merged
sunil-lakshman merged 7 commits intodevelopmentfrom Jun 5, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for nested global fields by allowing an api_version option to be passed through stack/global_fields methods and updating tests and documentation accordingly. Key changes include:
- Introduced
optionsparameter toglobal_fieldsandGlobalFieldsto setapi_versionheader per request. - Updated unit and integration tests to cover nested global fields create, update, delete, and fetch operations.
- Bumped SDK version to 1.5.0, updated changelog, and adjusted
.talismanrcignores.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/global_fields/test_global_fields_unittest.py | Added nested global_fields unit tests |
| tests/api/global_fields/test_global_fields_api.py | Added nested global_fields API tests and placeholder UID |
| contentstack_management/stack/stack.py | Updated global_fields signature to accept options |
| contentstack_management/global_fields/global_fields.py | Added header logic and cleanup for api_version in CRUD |
| contentstack_management/init.py | Bumped version to 1.5.0 |
| CHANGELOG.md | Documented v1.5.0 release note |
| .talismanrc | Added new test files to ignore list |
Comments suppressed due to low confidence (3)
tests/unit/global_fields/test_global_fields_unittest.py:80
- Missing assertion for
response.request.body, you should verify that the payload is correctly serialized to JSON to ensure the nested fields data is sent.
response = self.client.stack(api_key).global_fields(options={"api_version": 3.2}).create(read_mock_global_fileds_data)
contentstack_management/global_fields/global_fields.py:181
- The empty-string check is ineffective. To also catch
'', useif not self.global_field_uid:or explicitly compareself.global_field_uid == ''.
if self.global_field_uid is None or '':
contentstack_management/stack/stack.py:296
- The previous API key header validation was removed. Consider re-adding a check to raise an error if
api_keyis missing to prevent silent misconfiguration.
def global_fields(self, global_field_uid=None, options=None):
nadeem-cs
approved these changes
Jun 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.