Skip to content

Configuration and Constants Issues #838

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

Merged
merged 8 commits into from
Jun 16, 2025
Merged

Configuration and Constants Issues #838

merged 8 commits into from
Jun 16, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 5, 2025

  • Analyze repository structure and understand the issues
  • Identify the three specific problems in the codebase:
    • Issue 1: Magic strings in IsCaeChallengeResponse function
    • Issue 2: Incorrect RX domain constants for PowerApps Advisor API
    • Issue 3: Type safety issue in AuxiliaryTenantIDs conversion
  • Fix Issue 1: Add constants for CAE challenge detection strings
  • Fix Issue 2: Correct RX PowerApps Advisor API domain constants
  • Fix Issue 3: Implement proper type safety for AuxiliaryTenantIDs conversion
  • Run tests to validate all fixes
  • Run linter and generate documentation

Fixes #824.


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

@mawasile
Copy link
Contributor

mawasile commented Jun 5, 2025

@copilot continue with your work

Copy link
Contributor Author

Copilot AI commented Jun 5, 2025

@copilot continue with your work

I'll continue working on the three issues identified. Let me fix them one by one:

  1. Add constants for CAE challenge detection strings
  2. Correct RX PowerApps Advisor API domain constants
  3. Fix type safety issue in AuxiliaryTenantIDs conversion

…ain constants, and AuxiliaryTenantIDs type safety

Co-authored-by: mawasile <50197777+mawasile@users.noreply.github.com>
Copilot finished work on behalf of mawasile June 5, 2025 11:53
@mawasile
Copy link
Contributor

mawasile commented Jun 5, 2025

@copilot add changelot

Co-authored-by: mawasile <50197777+mawasile@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 5, 2025

@copilot add changelot

I've added the changelog entry for the configuration and constants fixes. The entry documents the three fixes made for issue #824: CAE challenge detection strings, RX PowerApps Advisor API domain constants, and AuxiliaryTenantIDs type safety conversion. Commit: 7af8e65

Copilot finished work on behalf of mawasile June 5, 2025 12:18
@mawasile mawasile changed the title [WIP] [Copilot] Configuration and Constants Issues Configuration and Constants Issues Jun 5, 2025
@mawasile mawasile marked this pull request as ready for review June 5, 2025 13:37
@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 13:37
@mawasile mawasile requested a review from a team as a code owner June 5, 2025 13:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses configuration and constants issues by replacing hard-coded strings, correcting domain constants, and improving type safety in tenant ID conversion.

  • Introduces constants for CAE challenge detection.
  • Updates RX PowerApps Advisor API domain and scope.
  • Adds type-safe handling for AuxiliaryTenantIDs conversion.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
internal/provider/provider.go Use a type assertion for AuxiliaryTenantIDs.Elements() conversion
internal/constants/constants.go Correct Advisor API constants and add CAE challenge indicators
internal/api/client.go Refactor IsCaeChallengeResponse to use the new constants
.changes/unreleased/fixed-20250605-121743.yaml Add changelog entry for these fixes
Comments suppressed due to low confidence (2)

internal/provider/provider.go:312

  • There are no existing tests covering type assertions in this loop. Adding unit tests for both successful and failed assertions will ensure behavior remains correct.
auxiliaryTenantIDsList := make([]string, len(auxiliaryTenantIDs.Elements()))

internal/api/client.go:86

  • Consider adding unit tests for IsCaeChallengeResponse to verify behavior with various WWW-Authenticate headers, including edge cases where one or both indicators are missing.
return strings.Contains(wwwAuthenticate, constants.CAE_CHALLENGE_CLAIMS_INDICATOR) &&

@mawasile mawasile added ai assisted Pull requests that have be fully or partially implemented using Copilot or AI ai found Issues and Bugs that were found using AI copilot fixed using GitHub copilot autonomous agent labels Jun 9, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: mawasile <50197777+mawasile@users.noreply.github.com>
Copilot finished work on behalf of mawasile June 9, 2025 13:47
mattdot
mattdot previously approved these changes Jun 12, 2025
eduardodfmex
eduardodfmex previously approved these changes Jun 12, 2025
@mattdot mattdot dismissed stale reviews from eduardodfmex and themself via 3c83072 June 12, 2025 18:52
@mawasile mawasile merged commit 6f4662d into main Jun 16, 2025
15 checks passed
@mawasile mawasile deleted the copilot/fix-824 branch June 16, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai assisted Pull requests that have be fully or partially implemented using Copilot or AI ai found Issues and Bugs that were found using AI copilot fixed using GitHub copilot autonomous agent
Projects
None yet
Development

Error loading sessions

Retrying...

Successfully merging this pull request may close these issues.

[Copilot] Configuration and Constants Issues
4 participants