-
Couldn't load subscription status.
- Fork 0
feat(os-modules): add tasks lib for OS modules management #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update introduces a new task automation structure for managing Terraform open-source modules. The main addition is a Taskfile under Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Taskfile (root)
participant OS Modules Taskfile
participant GitHub (template repo)
participant Module Repo
User->>Taskfile (root): Run os:sync [MODULES]
Taskfile (root)->>OS Modules Taskfile: Delegate sync task
OS Modules Taskfile->>GitHub (template repo): Clone template repo
loop For each module
loop For each file/directory
OS Modules Taskfile->>Module Repo: rsync file/dir from template
end
end
OS Modules Taskfile->>OS Modules Taskfile: Remove temp directory
OS Modules Taskfile->>User: Sync complete
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
lib/os-modules/Taskfile.yaml (3)
17-29: Consider refactoring DEFAULT_MODULES to a YAML sequence
Defining modules as a list improves readability and reduces backslash-based line-continuation complexity. You could use:vars: DEFAULT_MODULES: - terraform-aws-ssm-agent - terraform-aws-tailscale … MODULES: "{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}{{join .DEFAULT_MODULES \" \"}}{{end}}"
30-39: Use YAML sequence for FILES list
Listing files as a sequence and iterating with{{range .FILES}}makes the config clearer than a multi-line scalar.
40-52: Enhance script robustness with error handling and temp dir management
Addset -euo pipefailand usemktemp -dwith atrapto ensure clean up on errors, for example:set -euo pipefail TMP_DIR=$(mktemp -d) trap 'rm -rf "$TMP_DIR"' EXIT git clone --depth 1 https://github.com/... "$TMP_DIR" …Taskfile.yaml (1)
8-8: Register OS modules include alias
Theos: lib/os-modulesinclude correctly integrates the new sync tasks. Consider updating the project’s documentation to cover theos:syncinvocation.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.trunk/trunk.yaml(1 hunks)Taskfile.yaml(1 hunks)lib/os-modules/Taskfile.yaml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.yaml`: You are well-versed in writing and reviewing YAML configurations for the Task tool (https://taskfile.dev/). Provide recommendations for clarity, maintainability, and a...
**/*.yaml: You are well-versed in writing and reviewing YAML configurations for the Task tool (https://taskfile.dev/).
Provide recommendations for clarity, maintainability, and adherence to Taskfile best practices, including usage of variables, environment blocks, and includes.
These configurations may also contain embedded Bash scripts or commands.
Demonstrate bash scripting best practices such as error handling, secure variable expansions, and clear documentation.
Taskfile.yamllib/os-modules/Taskfile.yaml
🔇 Additional comments (5)
.trunk/trunk.yaml (4)
3-3: CLI version bump
Upgraded the Trunk CLI to 1.22.12. Please verify compatibility by running local checks (e.g.,trunk versionandtrunk check --local).
7-7: Plugin source version update
Updated the Trunk plugin ref to v1.6.8. Ensure any plugin-driven workflows continue to function as expected.
11-14: Linter version bump approvals
Linter versions for actionlint, checkov, trivy, yamllint, markdownlint, prettier, and trufflehog have been updated. Runtrunk lint --localto confirm there are no new lint failures or config conflicts.Also applies to: 16-18
21-21: Node runtime version update
Bumped Node runtime to 18.20.5. Verify all Node-based tasks and scripts execute correctly under this new version.lib/os-modules/Taskfile.yaml (1)
1-1: Confirm Taskfile version consistency
This Taskfile uses version "3". Ensure it matches the root Taskfile version to avoid include mismatches.
502f64c to
990d250
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome and convenient!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it -- this a great start to more easily maintaining these repos 🙌
cc @westonplatter so he's aware of this 👍
🤖 I have created a release *beep* *boop* --- ## [0.3.0](v0.2.0...v0.3.0) (2025-04-28) ### Features * **os-modules:** add tasks lib for OS modules management ([#15](#15)) ([d52cc04](d52cc04)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## what - This updates the module with configs from the template module. - Made entirely with taskit (except of REAME), see masterpointio/taskit#15 ## why - Keep standard configs in order. ## references - [INT-26](https://www.notion.so/masterpoint/Sync-repo-with-our-standard-files-149859758a568022871feb164c434990?pvs=4) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced automated dependency update management and documentation generation workflows. - Added a new workflow to run Terraform tests automatically on pushes and pull requests. - **Bug Fixes** - Improved .gitignore rules to better manage Terraform lock files in examples. - **Chores** - Updated code ownership to the open-source team. - Upgraded versions of tools, linters, and plugins for better reliability and security. - Enhanced and clarified configuration files for review automation, markdown linting, and tool management. - **Documentation** - Expanded and improved the README with branding, contribution guidelines, and license details. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
what
This PR introduces a new task for synchronizing common files and directories across our TF OS module repositories from a central template repository.
Added
os:synctask for automated synchronization of common files.Added
os:pull-and-branchtask to pull the latest default branch and create a branch from it.Added the
os:sync-alltask, which combines all of the above.Added the
os:pushtask, which pushes changes to the remote repo. It wasn't added toos:sync-allintentionally to avoid undesired changes.Supports syncing to both default and custom module repositories
Implements rsync with archive mode for preserving file attributes.
Files Synchronized
.github/(directory).trunk/(directory).coderabbit.yaml.editorconfig.gitignore.terraform-docs.yamlLICENSEaqua.yamlDefault Behavior
This syncs files to all default Terraform module repositories hardcoded in the taskfile.
Custom Repositories
Details:
.tmp-template-sync) for template repository-a(archive),-v(verbose), and--deleteoptionsImportant: Files in destination repositories that no longer exist in the template will be removed
why
references
Summary by CodeRabbit