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

Fix(GH) : account token component not finding correct account #3172

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

connorivy
Copy link
Contributor

Description & motivation

Account token component was broken by this PR #3141 which changed the behavior of accounts

This PR applies the same fix that was used for the other components that depended on the account component.

Changes:

To-do before merge:

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

"Account to get the auth token from. Expects the `userId`",
GH_ParamAccess.item
);
pManager.AddParameter(new SpeckleAccountParam());
Copy link
Member

Choose a reason for hiding this comment

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

This changes the input parameter type, which would be a breaking change for users with GH scripts with this component that are passing in a text parameter. Are we okay with this @AlanRynne ?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, looks like the input node was an Accounts node which previously passed the user id as the output now passes the Account object. Looks good to go ✌️

Copy link
Contributor

Choose a reason for hiding this comment

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

Just triple checked that this is fine. Old files continue to work with the new changes, although there is a small caveat.

@clairekuang clairekuang self-requested a review February 13, 2024 14:51
Copy link
Contributor

@AlanRynne AlanRynne left a comment

Choose a reason for hiding this comment

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

These changes do the trick except for updating both name and description of the account input. Built with this branch, i tested an opening a file with an existing "Get Token From Account" component

Screenshot 2024-02-14 at 09 58 11

While the a newly placed component will look like this:

Screenshot 2024-02-14 at 09 58 15

I'm not sure this is a big enough issue to request changing this.
The solution would involve:

  • Leaving the original component intact and flag it as obsolete
  • Creating a brand new component with these changes
  • Create a class that implements IGH_UpgradeObject to define what is involved in "upgrading" an existing component to the new one.

This would also have the side-effect of forcing the users to upgrade their existing nodes in each file (which is Grasshopper recommended approach), which I'm not sure it's worth it as this will only affect descriptions and names of pre-existing components, but the components will work as expected

"Account to get the auth token from. Expects the `userId`",
GH_ParamAccess.item
);
pManager.AddParameter(new SpeckleAccountParam());
Copy link
Contributor

Choose a reason for hiding this comment

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

Just triple checked that this is fine. Old files continue to work with the new changes, although there is a small caveat.

@AlanRynne AlanRynne self-requested a review February 14, 2024 14:35
Copy link
Contributor

@AlanRynne AlanRynne left a comment

Choose a reason for hiding this comment

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

Approving after discussion during standup.

Opened ticket to polish off the UI quirks in my comment https://spockle.atlassian.net/browse/CNX-8923

@AlanRynne AlanRynne merged commit 96881e5 into dev Feb 14, 2024
32 checks passed
@AlanRynne AlanRynne deleted the gh/connor/fix-account-token-component branch February 14, 2024 14:39
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