Repository navigation
fix(modules/folder): pass the folder number to the logging settings - #359
Merged
aghassemlouei merged 1 commit intoOct 26, 2026
Merged
Conversation
The google_logging_folder_settings resource builds the
folders/{{folder}}/settings URL itself, so the folders/ prefix of the
folder ID doubled it and the API returned 404 on every folder with
logging_settings, such as the Stage 0 common services folder.
- Add a folder_number local, matching the local of the same name in the
upstream Fabric folder module. trimprefix keeps a bare folder number
that callers pass with folder_create = false.
- Pass it to google_logging_folder_settings.
- Add a test for both.
11 of 19 tasks
9 of 19 tasks
aghassemlouei
left a comment
Member
There was a problem hiding this comment.
Verified modules/folder with terraform test (mock_provider), bash tools/run_tests.sh (tests/test_folder_logging_settings.py), and bash tools/lint.sh:
local.folder_number = trimprefix(local.folder_id, "folders/")normalizes both newly created folders (google_folder.folder[0].idreturningfolders/<number>) and existing folders (folder_create = false) sogoogle_logging_folder_settings.default[0].folderalways receives the bare folder number expected by the Cloud Logging API.
aghassemlouei
approved these changes
Oct 26, 2026
Merged
15 of 26 tasks
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.
Description
Let Terraform apply the logging settings of a folder that the
modules/folder/module manages, which currently fails for every folder that sets thelogging_settingsvariable.The
google_logging_folder_settingsresource builds thefolders/{{folder}}/settingsURL itself. The module passes the folder ID with itsfolders/prefix, so the request goes to/v2/folders/folders/<number>/settingsand the API returns 404.logging_settingsvariable, so the first Stage 0 apply fails on it.folder_numberlocal inmodules/folder/main.tfstrips thefolders/prefix, matching the local of the same name in the upstream Cloud Foundation Fabric folder module.trimprefixfunction, so a caller that passes a bare folder number withfolder_create = falsekeeps working.google_logging_folder_settingsresource inmodules/folder/logging.tfnow uses that local.folders/prefix.tests/test_folder_logging_settings.pytest checks both changes.No GitHub issue exists for this change. The
stellarCLI work in #306 found it during a lab Stage 0 apply. The Fabric sync in #311 brings the same upstream code, so whichever merges second takes the upstream version.Type of Change
Deployment & Compliance Impact
Checklist
Code Quality & Reusability
modules/orfast/stages-aw/can be leveraged for this change.docs/naming-convention.md.Documentation
README.mdof the modified module or blueprint.Security
Testing
Testing Performed
mainfailed onmodule.branch-common-services-folder.google_logging_folder_settings.default[0]with a 404 for the/v2/folders/folders/<number>/settingsURL.terraform init -backend=falseandterraform validatepass for themodules/folder/module and thefast/stages-aw/0-bootstrap/stage.terraform fmt -checkpasses for the module.tools/check_documentation.pypasses for the module.uv run --locked pytestin the repository root passes 109 tests.main.