Skip to content

chore: simplified default patterns initialization - #5808

Merged
denis256 merged 3 commits into
mainfrom
5806-patterns-init
May 11, 2026
Merged

chore: simplified default patterns initialization#5808
denis256 merged 3 commits into
mainfrom
5806-patterns-init

Conversation

@denis256

@denis256 denis256 commented Apr 6, 2026

Copy link
Copy Markdown
Member

Description

Fixes #5806.

TODOs

Read the Gruntwork contribution guidelines.

  • I authored this code entirely myself
  • I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)]
  • I am adding or upgrading a dependency or adapted code and confirm it has a compatible open source license
  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Summary by CodeRabbit

  • Refactor

    • Streamlined retry mechanism initialization to enhance system reliability and code maintainability.
  • Documentation

    • Clarified documentation for transient error detection patterns used in retry operations, including terraform and tofu compatibility details.

@vercel

vercel Bot commented Apr 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
terragrunt-docs Ready Ready Preview, Comment Apr 30, 2026 5:45pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ecc60857-dae3-45e7-b7ea-15b2852a3728

📥 Commits

Reviewing files that changed from the base of the PR and between 45fe7da and f8ff005.

📒 Files selected for processing (1)
  • internal/retry/defaults.go

📝 Walkthrough

Walkthrough

The changes refactor DefaultRetryableRegexps initialization in internal/retry/defaults.go from an init() function using regexp.Compile with custom error handling to a package-level variable initialized via an IIFE using regexp.MustCompile. Documentation for DefaultRetryableErrors is updated to clarify these are terraform/tofu transient error regex patterns.

Changes

Cohort / File(s) Summary
Retry Pattern Initialization
internal/retry/defaults.go
Refactors DefaultRetryableRegexps variable initialization from init() function with regexp.Compile and custom panic formatting to IIFE with regexp.MustCompile. Removes explicit compile-error handling and updates DefaultRetryableErrors documentation to describe patterns as terraform/tofu transient error regexes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description references the linked issue #5806 but lacks detailed explanation of changes, specific implementation details, and contains incomplete release notes and migration guide sections. Provide detailed explanation of what was changed and why, complete the release notes with specific changes made, and clarify whether this is backward compatible.
Out of Scope Changes check ❓ Inconclusive The changes are limited to default patterns initialization refactoring; however, commit messages mention both patterns and errors initialization, suggesting potential scope expansion beyond the title. Clarify whether changes to default errors initialization are in scope for issue #5806 or if they represent out-of-scope modifications to the PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: simplifying default patterns initialization from init function to IIFE approach.
Linked Issues check ✅ Passed The PR successfully replaces init function initialization with function-based pattern building as required by issue #5806, improving the initialization approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 5806-patterns-init

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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@denis256
denis256 marked this pull request as ready for review April 30, 2026 20:16
@denis256
denis256 requested a review from yhakbar as a code owner April 30, 2026 20:16
@denis256
denis256 merged commit 7f295e0 into main May 11, 2026
95 of 97 checks passed
@denis256
denis256 deleted the 5806-patterns-init branch May 11, 2026 15:22
@github-actions github-actions Bot mentioned this pull request May 11, 2026
6 tasks
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.

Improve retry patterns init

2 participants