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

AJ-1234: Use helmchart name for pact identifier. #1234

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

jladieu
Copy link
Contributor

@jladieu jladieu commented Oct 30, 2023

This is prefactoring work for AJ-1234

This pairs with DataBiosphere/terra-workspace-data-service#384, where wds also renames its reference from sam-provider to just sam.

  • See thread discussing the -consumer and -provider suffix anti-pattern.
  • See thread discussing the recommendation to use the helm chart name.
  • See thread discussing doing this for sam.

jladieu added a commit to DataBiosphere/terra-workspace-data-service that referenced this pull request Oct 30, 2023
This pairs with broadinstitute/sam#1234, where `sam` also renames its reference from `sam-consumer` to just `sam`.

* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698068076950019) discussing the `-consumer` and `-provider` suffix anti-pattern.
* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698241095600099) discussing the recommendation to use the helmchart name.
jladieu added a commit to DataBiosphere/terra-workspace-data-service that referenced this pull request Oct 30, 2023
This pairs with broadinstitute/sam#1234, where `sam` also renames its reference from `sam-consumer` to just `sam`.

* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698068076950019) discussing the `-consumer` and `-provider` suffix anti-pattern.
* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698241095600099) discussing the recommendation to use the helmchart name.
@jladieu jladieu requested a review from mspector October 30, 2023 15:33
jladieu added a commit to DataBiosphere/terra-workspace-data-service that referenced this pull request Oct 30, 2023
Use helmchart names for pact identifiers.

This pairs with broadinstitute/sam#1234, where `sam` also renames its reference from `sam-consumer` to just `sam`.

* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698068076950019) discussing the `-consumer` and `-provider` suffix anti-pattern.
* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698241095600099) discussing the recommendation to use the helmchart name.
@@ -307,4 +307,4 @@ jobs:
repo: broadinstitute/terra-github-workflows
ref: refs/heads/main
token: ${{ secrets.BROADBOT_TOKEN }} # github token for access to kick off a job in the private repo
inputs: '{ "pacticipant": "sam-provider", "version": "${{ needs.verify-consumer-pact.outputs.provider-sha }}" }'
inputs: '{ "pacticipant": "sam", "version": "${{ needs.verify-consumer-pact.outputs.provider-sha }}" }'
Copy link
Contributor

Choose a reason for hiding this comment

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

sam also can be a consumer, will this cause any name collisions/issues with that?

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 think ultimately what we want is for sam to self-identify itself as sam when acting in both the provider and consumer role. I think this will let the pact-broker do some dependency graph magic which is currently stymied by having the consumer/provider roles named divergently.

So I think there may be some followup work to rename the consumer side of things as well, but I wanted to try to keep the scope of this change as tight as possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok nice that makes sense thanks! btw side-note the verify-consumer-pact action was failing on our pr's and it looks like this change fixed it...?

Copy link
Contributor Author

@jladieu jladieu Oct 31, 2023

Choose a reason for hiding this comment

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

Oh dang, I didn't realize these were failing previously.

And, I hate to disappoint... but I think that's actually a false 'pass' on this PR...

The first time a pact verification runs for a given provider (in this case, the newly renamed sam) it treats the contracts as being in a 'pending' state, and quietly passes the tests (even if they're failing).

You need to go to the logs to see that the tests are still failing with the same looking stack traces as before this PR.

Copy link
Contributor Author

@jladieu jladieu Oct 31, 2023

Choose a reason for hiding this comment

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

Took a quick look at the failure @Ghost-in-a-Jar and I think it's because the verify_consumer_pacts.yml needs to somehow run /bin/bash -c env/test.env as part of setting up its environment before running sbt test on the SamProviderSpec.

I tried a few different incantations (see 5d547ce for latest attempt) but kept hitting permission problems, so I am backing that commit out.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok good to know thanks for taking a look!

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect, thanks! I picked up that change and will see how re-running looks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Ghost-in-a-Jar I think you fixed the issue with permissions, but it looks like maybe another false pass on the PR you linked: If you take a look at: https://github.com/broadinstitute/sam/actions/runs/6711027848/job/18237474362 I'm still seeing some errors (despite the GHA passing).

Example:

    1.1) body: $.userEmail Expected '[email protected]' (String) but received '[email protected]' (String)

    1.2) body: $.userSubjectId Expected 'testUser' (String) but received '509175583607142998ceb' (String)

The bright side is the errors look like they're a lot easier to troubleshoot than the one you fixed since they're concrete pact problems rather than connectivity issues.

@jladieu jladieu force-pushed the rename-sam-provider branch 3 times, most recently from 5d547ce to 9bc2592 Compare October 31, 2023 15:57
Copy link

sonarcloud bot commented Oct 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

This pairs with DataBiosphere/terra-workspace-data-service#384, where `wds` also renames its reference from `sam-provider` to just `sam`.

* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698068076950019) discussing the `-consumer` and `-provider` suffix anti-pattern.
* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698241095600099) discussing the recommendation to use the helm chart name.
* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698262189799389) discussing doing this for `sam`.
jladieu added a commit to DataBiosphere/terra-billing-profile-manager that referenced this pull request Nov 3, 2023
Prefer helmchart name as the pacticipant identifier:
* `bpm-provider` -> `bpm`
* `bpm-consumer` -> `bpm`
* `sam-provider` -> `sam`
* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698068076950019) discussing the `-consumer` and `-provider` suffix anti-pattern.
* See [thread](https://broadinstitute.slack.com/archives/C043YJ40719/p1698241095600099) discussing the recommendation to use the helm chart name.

Unblocks:
* broadinstitute/rawls#2610
* DataBiosphere/terra-workspace-manager#1511
* broadinstitute/sam#1234
@jladieu jladieu merged commit d9a6342 into develop Nov 6, 2023
24 checks passed
@jladieu jladieu deleted the rename-sam-provider branch November 6, 2023 20:32
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.

4 participants