Skip to content

Move dashboard service provider seeding to run-time from image-build time#9628

Merged
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/runtime-dashboard-seed-for-review-apps
Nov 20, 2023
Merged

Move dashboard service provider seeding to run-time from image-build time#9628
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/runtime-dashboard-seed-for-review-apps

Conversation

@mitchellhenke
Copy link
Contributor

🛠 Summary of changes

Follow-up to #9563. We use the IDP review app image in other application pipelines (dashboard, PKI) and those must be able to provision a dashboard that works with their IDP. Building the service_providers.yml in the image means it will only work for that review app universe.

This PR moves it to the runtime of the db:seed task so that a PR in identity-dashboard can provision an IDP and use the correct URL for the dashboard.

…time

changelog: Internal, Review Applications, Move dashboard service provider seeding to run-time from image-build time
@mitchellhenke mitchellhenke requested a review from a team November 20, 2023 15:57
Comment on lines +2 to +10
if ENV['KUBERNETES_REVIEW_APP'] == 'true' && ENV['DASHBOARD_URL'].present?
dashboard_url = ENV['DASHBOARD_URL']

service_provider_seeder = ServiceProviderSeeder.new
service_provider_seeder.write_review_app_yaml(dashboard_url: dashboard_url)
service_provider_seeder.run
else
ServiceProviderSeeder.new.run
end
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe just for funsies what if we combined these with a .tap

Suggested change
if ENV['KUBERNETES_REVIEW_APP'] == 'true' && ENV['DASHBOARD_URL'].present?
dashboard_url = ENV['DASHBOARD_URL']
service_provider_seeder = ServiceProviderSeeder.new
service_provider_seeder.write_review_app_yaml(dashboard_url: dashboard_url)
service_provider_seeder.run
else
ServiceProviderSeeder.new.run
end
ServiceProviderSeeder.new.tap do |service_provider_seeder|
if ENV['KUBERNETES_REVIEW_APP'] == 'true' && ENV['DASHBOARD_URL'].present?
dashboard_url = ENV['DASHBOARD_URL']
service_provider_seeder.write_review_app_yaml(dashboard_url: dashboard_url)
end
end.run

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a soft preference for the initial implementation, it feels slightly clearer to me.

@mitchellhenke mitchellhenke merged commit bf8a549 into main Nov 20, 2023
@mitchellhenke mitchellhenke deleted the mitchellhenke/runtime-dashboard-seed-for-review-apps branch November 20, 2023 18:20
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