-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: enable archival of repos #301
Conversation
Signed-off-by: James Ramirez <james.ramirez@grendel-consulting.com>
WalkthroughThis pull request introduces an Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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
CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
Terraform Cloud Plan OutputPlan: 0 to add, 2 to change, 0 to destroy. |
@coderabbitai review |
✅ Actions performedReview triggered.
|
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: 0
🧹 Nitpick comments (1)
modules/repository/repository.tf (1)
7-7
: Implementation is correct, consider archival implications.The
archived
attribute is properly implemented. However, be aware that archiving a repository:
- Makes it read-only
- Disables many features including issues, pull requests, and discussions
- Cannot be unarchived through Terraform (requires manual GitHub intervention)
Consider implementing a pre-archive checklist in your workflow to:
- Document the archival process
- Ensure important discussions and issues are properly resolved
- Update any external references to the repository
- Plan for potential future unarchiving needs
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
main.tf
(1 hunks)modules/repository/repository.tf
(1 hunks)modules/repository/variables.tf
(1 hunks)variables.tf
(1 hunks)
🔇 Additional comments (5)
main.tf (1)
16-16
: Implementation looks sound!
The archived
attribute implementation follows HashiCorp's recommended pattern for optional module attributes. Using null
as the default value allows for proper fallback to the variable's default in the repository module.
Let's verify the repository configurations:
✅ Verification successful
Implementation verified and working as expected
The verification confirms that:
- The
archived
variable in the repository module has a default value offalse
- Two repositories are configured to be archived in the locals block:
gatsby-baseline
remix-baseline
- The implementation properly passes the archived status from the root module to the repository module
The usage of lookup(each.value, "archived", null)
is correct as it allows repositories to:
- Be explicitly archived when
archived: true
is set - Use the module's default value (
false
) when not specified
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for repositories marked for archival
# Expected: Find any .tf files containing archived = true configurations
rg -l 'archived\s*=\s*true' --type tf
Length of output: 39
Script:
#!/bin/bash
# Let's check the repository module's variables.tf to understand the default value for archived
fd "variables.tf" --exec cat {} \;
# Also check if there are any repository configurations with archived set to any value
rg "archived\s*=" --type tf -A 2 -B 2
Length of output: 4581
modules/repository/variables.tf (1)
41-45
: Variable declaration is well-structured!
The archived
variable follows best practices with:
- Appropriate boolean type
- Sensible default value (false)
- Clear description
Let's verify no conflicting variable declarations exist:
✅ Verification successful
No duplicate variable declarations found
The archived
variable is only declared once in modules/repository/variables.tf
, confirming there are no conflicting declarations in the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any duplicate archived variable declarations
# Expected: Only one declaration should exist
rg -l 'variable\s+"archived"\s+{' --type tf
Length of output: 159
Script:
#!/bin/bash
# Description: Check for any duplicate archived variable declarations
# Expected: Only one declaration should exist
rg -l 'variable "archived"' --type tf
Length of output: 71
variables.tf (3)
20-22
: Implementation looks sound
The archival flags are correctly implemented within the repository configuration structure. The changes maintain consistent formatting and follow the established pattern for repository definitions.
22-22
: Ensure remix-baseline archival impact is documented
Before archiving, please:
- Document the rationale for archival in the repository README
- Update any organisation documentation that references this baseline
- Consider adding a notice about recommended alternatives
Let's verify the repository's current state and usage:
✅ Verification successful
Let me try another search strategy to gather more information about the repository usage.
Repository archival confirmed - documentation updates recommended
The repository remix-baseline
is already archived according to the GitHub API response, and our searches show minimal integration across the organisation. However, proper documentation of this archival decision is still important for future reference.
Please ensure:
- Add a section to the repository's README explaining why it was archived
- Document any recommended alternatives for teams looking to start new Remix projects
- Update the repository description to indicate its archived status
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for references to remix-baseline across the organisation
rg -i "remix-baseline" --type yaml --type typescript --type javascript
# Check repository status and dependents
gh api graphql -f query='
{
repository(owner: "grendel-consulting", name: "remix-baseline") {
dependencyGraphManifests(first: 10) {
nodes {
dependencies(first: 10) {
nodes {
repository {
nameWithOwner
}
}
}
}
}
isArchived
}
}'
Length of output: 520
Script:
#!/bin/bash
# Check for references to remix-baseline in markdown files and package.json
rg -i "remix-baseline" --type md --type json
# Check if there's a README in the repository
fd "README.md" --type f --exec cat {}
Length of output: 276
20-20
: Please verify that gatsby-baseline is ready for archival
Before proceeding with archival, ensure that:
- No active projects depend on this baseline
- Documentation is updated to reflect the archived status
- A clear migration path exists for existing users
Let's check for repository dependencies and recent activity:
✅ Verification successful
Let me gather more information about potential dependencies and usage:
Archival of gatsby-baseline repository appears appropriate
Based on the verification results:
- The repository is already marked as archived on GitHub
- Recent commits show intentional preparation for archival ("chore: prepare to archive repo")
- No open pull requests exist
- No direct references found in JSON or Markdown files across the codebase
- Only one fork exists, which can continue independently
The archival status in variables.tf
aligns with the repository's current state and recent administrative actions. The change appears to be part of a coordinated archival process.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for references to gatsby-baseline across the organisation
rg -i "gatsby-baseline" --type yaml --type typescript --type javascript
# Check for forks that might be affected
gh api graphql -f query='
{
repository(owner: "grendel-consulting", name: "gatsby-baseline") {
forks {
totalCount
}
updatedAt
isArchived
}
}'
Length of output: 380
Script:
#!/bin/bash
# Search for references to gatsby-baseline in package.json files and other potential dependency files
rg -i "gatsby-baseline" --type json --type markdown
# Check for any recent commits or PRs
gh api graphql -f query='
{
repository(owner: "grendel-consulting", name: "gatsby-baseline") {
defaultBranchRef {
target {
... on Commit {
history(first: 5) {
nodes {
committedDate
messageHeadline
}
}
}
}
}
pullRequests(last: 5, states: [OPEN]) {
nodes {
title
updatedAt
}
}
}
}'
Length of output: 1196
Summary by CodeRabbit
New Features
Updates
Configuration
archived
added to control repository archival statusfalse