fix: allow for custom URL and inital testing#2
Conversation
The provider was hardcoding the project API URL to
`https://{slug}.projects.oryapis.com`, which doesn't work for
staging environments that use `projects.staging.oryapis.dev`.
This adds a new `project_api_url` provider attribute that accepts
a URL template with `%s` as placeholder for the project slug.
Examples:
- Production (default): `https://%s.projects.oryapis.com`
- Staging: `https://%s.projects.staging.oryapis.dev`
The attribute can also be set via the `ORY_PROJECT_API_URL`
environment variable.
The Ory SDK has hardcoded operation-specific server URLs for all console API operations (ProjectAPI, WorkspaceAPI, EventsAPI) in the default Configuration. These operation servers override the main Servers config, causing all console API requests to be sent to production (api.console.ory.sh) even when console_api_url is set to a staging URL. This fix explicitly overrides OperationServers for all console API operations to use the configured console_api_url, enabling proper support for staging and custom API endpoints.
piotrmsc
left a comment
There was a problem hiding this comment.
would be greate to add also on this PR already small GHA to execute go tests on files changed *.go
piotrmsc
left a comment
There was a problem hiding this comment.
small initial round with some ideas for improvements
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install jq |
There was a problem hiding this comment.
it's a dependency used in script, let's add it as dependency and then here just set up all dependencies
| enable_keto_tests: | ||
| description: 'Enable Keto/relationship tests' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| enable_b2b_tests: | ||
| description: 'Enable B2B/organization tests' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| enable_social_provider_tests: | ||
| description: 'Enable social provider tests' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| enable_schema_tests: | ||
| description: 'Enable identity schema tests' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| enable_project_tests: | ||
| description: 'Enable project create/delete tests' | ||
| required: false | ||
| default: true | ||
| type: boolean |
There was a problem hiding this comment.
What if we instead have input representing run all with default true, and then the post-merge, aka main pipeline, will run all tests by default, and if you want to manually trigger, then you can individually select which components/areas you want to test?
| paths: | ||
| - '**.go' | ||
| - 'go.mod' | ||
| - 'go.sum' | ||
| - '.github/workflows/acceptance-test.yml' |
There was a problem hiding this comment.
nit: I think will be better to use path filter which allows us to extend in the pipeline with conditional logic
fix: allow for custom URL and inital testing
Description
Add support for custom API URLs to enable testing against non-production environments (staging, dev, self-hosted).
Changes:
console_api_urlprovider attribute to override the Console API endpointproject_api_urlprovider attribute to override the Project API URL templateRelated Issues
Fixes: #1
Type of Change
Checklist
make test)make lint)Testing
Describe how you tested these changes:
Manual Testing Details
Screenshots/Output