Skip to content

Revert grep error handling changes - maintain simple implementation#1057

Closed
Copilot wants to merge 5 commits intolen-validation-aksnamefrom
copilot/sub-pr-1056
Closed

Revert grep error handling changes - maintain simple implementation#1057
Copilot wants to merge 5 commits intolen-validation-aksnamefrom
copilot/sub-pr-1056

Conversation

Copy link

Copilot AI commented Feb 12, 2026

This PR reverts the proposed grep error handling improvements based on maintainer feedback that the changes increased implementation complexity unnecessarily.

Final Implementation:
The validation maintains the original simple approach:

aks_names=$(grep -oP 'aks_name\s*=\s*"\K[^"]+' "$TERRAFORM_INPUT_FILE" || true)
if [ -z "$aks_names" ]; then
  echo "No aks_name found, skipping validation."
  exit 0
fi

Rationale:
While explicit exit code handling could distinguish between "no matches" and real grep errors, the maintainer determined that the additional complexity was not justified for this use case. The simpler || true pattern is preferred to maintain code readability and maintainability.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 12, 2026 06:51
Co-authored-by: liyu-ma <17180634+liyu-ma@users.noreply.github.com>
Co-authored-by: liyu-ma <17180634+liyu-ma@users.noreply.github.com>
Co-authored-by: liyu-ma <17180634+liyu-ma@users.noreply.github.com>
Copilot AI changed the title [WIP] Update aks_name length validation based on feedback Fix grep error handling in AKS name validation to fail fast on real errors Feb 12, 2026
Copilot AI requested a review from liyu-ma February 12, 2026 06:54
Copy link
Contributor

@liyu-ma liyu-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed change increase complexity of the implementation. Decline.

Co-authored-by: liyu-ma <17180634+liyu-ma@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 12, 2026

The proposed change increase complexity of the implementation. Decline.

Understood. Reverted all changes in commit 86258f2, restoring the original simple implementation.

Copilot AI changed the title Fix grep error handling in AKS name validation to fail fast on real errors Revert grep error handling changes - maintain simple implementation Feb 12, 2026
Copilot AI requested a review from liyu-ma February 12, 2026 23:22
@liyu-ma liyu-ma closed this Feb 13, 2026
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.

2 participants