Skip to content

Conversation

Copy link

Copilot AI commented May 31, 2025

This PR adds a new defaultRepository setting to the global configuration file (~/.azbootstrap-globals.jsonc) that provides a default template repository when running in interactive mode.

Changes Made

Core Functionality

  • Modified Start-AzBootstrapInteractiveMode.ps1: Added logic to load the global config and use defaultRepository as the default when prompting for template repository URL
  • Safety: Only applies in interactive mode - never used in non-interactive/automated scenarios to prevent unintended consequences

Configuration & Documentation

  • Updated .azbootstrap-globals.jsonc.example: Added defaultRepository setting example
  • Enhanced README.md: Added comprehensive documentation explaining the new setting and its behavior

Testing

  • Extended Test-Interactive.Tests.ps1: Added focused tests covering both scenarios (config present/absent)
  • All tests pass: 31 tests passing, confirming no regression

Usage Example

{
    "templateAliases": {
        "terraform": "https://github.com/kewalaka/terraform-azure-starter-template",
        "bicep": "https://github.com/kewalaka/bicep-azure-starter-template"
    },
    "defaultLocation": "eastus",
    "defaultRepository": "terraform"  // Can be alias, shorthand, or full URL
}

When running interactively without specifying a template repository:

Enter Template Repository URL [terraform]: <press Enter>
# Uses the terraform alias from your config instead of the hardcoded default

Key Features

  • Flexible values: Accepts template aliases, GitHub shorthand (owner/repo), or full URLs
  • Interactive mode only: Preserves safety in automated scenarios as requested
  • Backwards compatible: Falls back to existing hardcoded default when no setting is present
  • Follows existing patterns: Uses the same global config system as defaultLocation

Fixes #49.


💡 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.

Co-authored-by: kewalaka <3146590+kewalaka@users.noreply.github.com>
Copilot AI changed the title [WIP] add a default repository to Tuesday global settings Add defaultRepository global setting for interactive mode May 31, 2025
Copilot AI requested a review from kewalaka May 31, 2025 04:54
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.

add a default repository to global settings

1 participant