Skip to content
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

Improve Terraform Provider integration testing #1329

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

kian99
Copy link
Contributor

@kian99 kian99 commented Aug 27, 2024

Description

This PR makes some tweaks after testing JIMM with the Juju Terraform Provider. The changes of note are:

  • Install the jaas plugin snap in the setup JIMM action.
  • Setup the service account with a cloud-credential in the setup JIMM action.
  • Fix a bug in GetApplicationOfferConsumeDetails to exclude the user field which currently causes an unknown error.
  • Pass permission map to the cache dialer.

Partially addresses CSS-6347

Engineering checklist

Check only items that apply

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

@kian99 kian99 requested a review from a team as a code owner August 27, 2024 13:44
@kian99 kian99 changed the title tweaks to improve integration testing Improve Terraform Provider integration testing Aug 27, 2024
Copy link
Contributor

@ale8k ale8k left a comment

Choose a reason for hiding this comment

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

lgtm some questions, ping me on mm when responded please!

@@ -37,7 +37,7 @@ services:
JIMM_OAUTH_CLIENT_SECRET: "SwjDofnbDzJDm9iyfUhEp67FfUFMY8L4"
JIMM_OAUTH_SCOPES: "openid profile email" # Space separated list of scopes
JIMM_DASHBOARD_FINAL_REDIRECT_URL: "https://jaas.ai" # Example URL
JIMM_ACCESS_TOKEN_EXPIRY_DURATION: 1h
JIMM_ACCESS_TOKEN_EXPIRY_DURATION: 100h
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make local dev less tedious, you don't need to repeatedly login.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah oki I'm with you

@@ -44,7 +44,7 @@ func (d *cacheDialer) Dial(ctx context.Context, ctl *dbmodel.Controller, mt name
return d.dialer.Dial(ctx, ctl, mt, requiredPermissions)
}
rc := d.sfg.DoChan(ctl.Name, func() (interface{}, error) {
return d.dial(ctx, ctl)
return d.dial(ctx, ctl, requiredPermissions)
Copy link
Contributor

Choose a reason for hiding this comment

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

How did this work before without the permissions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are default permissions set in the dialer so that probably resolves most issues because we don't add extra permissions in many places, and I believe the cache dialer is not used unless actually running JIMM?
We also probably want to get rid of the cache dialer, but this is still better than before.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I need to look over the default permissions, never really fully understood the permission map and what goes where... But oki thank you!

internal/jujuclient/applicationoffers.go Show resolved Hide resolved
Copy link
Contributor

@pkulik0 pkulik0 left a comment

Choose a reason for hiding this comment

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

Finally no need to sign in over and over again, ty

@kian99 kian99 merged commit d809f13 into canonical:v3 Aug 28, 2024
4 checks passed
kian99 added a commit to kian99/jimm that referenced this pull request Sep 3, 2024
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.

3 participants