Skip to content

Set default endpoints based on API key #679

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 6 commits into from
Jun 24, 2025
Merged

Set default endpoints based on API key #679

merged 6 commits into from
Jun 24, 2025

Conversation

twometresteve
Copy link

Goal

Set default endpoints based on API key. If no endpoint is configured, payloads should be sent to *.insighthub.smartbear.com if the API key starts with 00000.

Changeset

The unit tests have started failing with PHP 8.4 before this change due to a language deprecation. A ticket has been raised to investigate that further.

Testing

Unit tests added and I've run some manual tests locally with an example app, verifying that the requested host is as expected for different API keys.

@twometresteve twometresteve requested a review from Copilot June 16, 2025 16:16
Copy link

@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 sets default endpoints based on the API key to support InsightHub integration.
Key changes:

  • Added unit tests for hub-specific notify, session, and build endpoints.
  • Updated the Configuration class to set endpoints based on whether the API key starts with "00000".
  • Updated the CHANGELOG and modified the test workflow to skip PHP 8.4 tests pending investigation of a deprecation.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/ConfigurationTest.php Added tests to verify hub-specific endpoint defaults.
src/Configuration.php Introduced hub endpoint constants and logic to select endpoints.
CHANGELOG.md Documented the enhancement for API key based endpoint defaults.
.github/workflows/test-package.yml Commented out PHP 8.4 tests pending further deprecation investigation.

Copy link

@richardelms richardelms left a comment

Choose a reason for hiding this comment

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

looks good to me 👍

@twometresteve twometresteve merged commit 0f63b27 into next Jun 24, 2025
48 checks passed
@twometresteve twometresteve deleted the tms/hub-api-key branch June 24, 2025 12:27
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