Skip to content

e2e: app registration cleanup of orphaned app registrations that are expired#4813

Merged
openshift-merge-bot[bot] merged 1 commit intomainfrom
bvesel/clean-app-registrations-periodically
Apr 14, 2026
Merged

e2e: app registration cleanup of orphaned app registrations that are expired#4813
openshift-merge-bot[bot] merged 1 commit intomainfrom
bvesel/clean-app-registrations-periodically

Conversation

@bennerv
Copy link
Copy Markdown
Member

@bennerv bennerv commented Apr 8, 2026

ARO-25877

What

Creates a cleanup job for orphaned app registrations that didn't get cleaned up due to e2e panics or other things.

Why

Ensures that we clean up app registrations with expired credentials so they don't fill our object quota in our tenants.

Testing

openshift/release pj-rehearse plugin, otherwise ran locally.

Special notes for your reviewer

Copilot AI review requested due to automatic review settings April 8, 2026 21:20
@openshift-ci openshift-ci bot requested review from deads2k and mgahagan73 April 8, 2026 21:21
@openshift-ci openshift-ci bot added the approved label Apr 8, 2026
Copy link
Copy Markdown
Contributor

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

Adds a new cleanup subcommand to the aro-hcp-tests tooling to remove orphaned/expired e2e Microsoft Entra app registrations, and extends the curated Microsoft Graph Kiota spec + generated client to support listing owned applications.

Changes:

  • Add cleanup app-registrations command and supporting options/run logic to delete expired e2e app registrations (with --dry-run support).
  • Extend the Graph Kiota OpenAPI subset + generated client with /me/ownedObjects/graph.application.
  • Standardize the e2e app registration name prefix via a shared graphutil.AppRegistrationPrefix constant.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tooling/kiota/README.md Documents how to maintain the curated Graph OpenAPI subset.
tooling/kiota/openapi.yaml Adds the /me/ownedObjects/graph.application endpoint to the curated spec.
test/util/framework/per_test_framework.go Uses the shared app registration name prefix constant.
test/util/cleanup/appregistrations/options.go Wires up Graph client acquisition for the new cleanup job.
test/util/cleanup/appregistrations/run.go Implements list-and-delete flow for expired app registrations (dry-run supported).
test/cmd/aro-hcp-tests/cleanup/cmd.go Adds the new cleanup app-registrations cobra subcommand.
internal/graph/util/applications.go Adds ListOwnedExpiredApplications and the AppRegistrationPrefix constant.
internal/graph/graphsdk/me/* Adds generated request builders for the /me/ownedObjects/graph.application calls.
internal/graph/graphsdk/graph_base_service_client.go Exposes .Me() on the generated Graph service client.
internal/graph/graphsdk/kiota-lock.json Updates Kiota lock hash due to spec changes.
internal/graph/graphsdk/models/odataerrors/inner_error.go Fixes typo in generated comments (“occurred”).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/graph/util/applications.go Outdated
Comment thread internal/graph/util/applications.go Outdated
Comment thread internal/graph/util/applications.go Outdated
@bennerv
Copy link
Copy Markdown
Member Author

bennerv commented Apr 8, 2026

/hold - need to confirm against a service principal login vs. a user login.

@bennerv bennerv force-pushed the bvesel/clean-app-registrations-periodically branch from 9b23298 to d76c603 Compare April 9, 2026 14:00
@bennerv bennerv force-pushed the bvesel/clean-app-registrations-periodically branch from d76c603 to 765e641 Compare April 9, 2026 20:28
Copilot AI review requested due to automatic review settings April 9, 2026 20:28
@bennerv
Copy link
Copy Markdown
Member Author

bennerv commented Apr 9, 2026

/hold cancel

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/graph/util/applications.go
Comment thread internal/graph/util/applications.go Outdated
Comment thread tooling/kiota/openapi.yaml Outdated
@bennerv bennerv force-pushed the bvesel/clean-app-registrations-periodically branch from 765e641 to a1816da Compare April 10, 2026 14:47
Copilot AI review requested due to automatic review settings April 13, 2026 13:23
@bennerv bennerv force-pushed the bvesel/clean-app-registrations-periodically branch from a1816da to 1d400be Compare April 13, 2026 13:23
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/util/cleanup/appregistrations/options.go
Comment thread internal/graph/util/client.go
Comment thread internal/graph/util/applications.go
@geoberle
Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bennerv, geoberle

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 8ba6187 into main Apr 14, 2026
27 checks passed
@openshift-merge-bot openshift-merge-bot bot deleted the bvesel/clean-app-registrations-periodically branch April 14, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants