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

[ENG-6774] fix computing model / service names (and some citations, too!) #2437

Conversation

felliott
Copy link
Member

@felliott felliott commented Dec 26, 2024

Purpose

The new Boa addon is trying to POST a relationship called computing-service rather than external-computing-service. After investigation, it looks like some of the naming conventions for computing have gone stale and need to be updated.

Summary of Changes

  • Update computing model names to be consistent with their storage and citation brethren, i.e. AuthorizedComputingAccount => AuthorizedComputingAccountModel
  • Update relationship reference names from computingService to externalComputingService to match the gv API.
  • Fix a few spots for citations with the same issues.
  • fix a misspelling in the en_us key translations
  • set the default capabilities for computing addons

Screenshot(s)

nope

Side Effects

still testing, will let you know!

QA Notes

Don't think so.

Ticket

ENG-6774

@felliott felliott force-pushed the feature/fix-computing-names branch 2 times, most recently from a058662 to bbe7889 Compare December 30, 2024 17:14
@felliott felliott changed the title [WIP][ENG-6774] fix computing model / service names (and some citations, too!) [ENG-6774] fix computing model / service names (and some citations, too!) Dec 30, 2024
Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

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

Looks good and thank you for cleaning up some of the mess I've left behind! Just a couple of small questions/suggestions, but nothing that's a blocker for me

@@ -2350,7 +2350,7 @@ routes:
institution: Institution
email: Email
osf-components:
addons-srvice:
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, good catch!

@belongsTo('user-reference', { inverse: 'authorizedComputingAccounts' })
accountOwner!: AsyncBelongsTo<UserReferenceModel> & UserReferenceModel;

@belongsTo('external-computing-service')
computingService!: AsyncBelongsTo<ExternalComputingService> & ExternalComputingService;
externalComputingService!: AsyncBelongsTo<ExternalComputingServiceModel> & ExternalComputingServiceModel;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ack, sorry for the inconsistent naming here!

Copy link
Contributor

Choose a reason for hiding this comment

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

Again sorry for the inconsistent implementations! Should have taken the extra few seconds to update the computingService methods while I was in here last messing with the createAuthorizedXYZAccounts and createConfiguredXYZAddons

get invalidDisplayName() {
return !this.displayName || this.displayName?.trim().length === 0;
}

get disableSave() {
return !this.selectedFolder || this.invalidDisplayName || this.args.onSave.isRunning;
return this.hasRootFolder && (!this.selectedFolder || this.invalidDisplayName || this.args.onSave.isRunning);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this condition always return false when this.args.authorizedAccount is an AuthorizedComputingAccount, meaning the save button is always enabled? Or have I confused myself with the logic?

I think it should be something like this (I've rearranged the checks to make it a little easier for myself):

Suggested change
return this.hasRootFolder && (!this.selectedFolder || this.invalidDisplayName || this.args.onSave.isRunning);
return this.invalidDisplayName || this.args.onSave.isRunning || (this.hasRootFolder && !this.selectedFolder) || ;

Copy link
Member Author

Choose a reason for hiding this comment

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

D'oh! Absolutely right. I will fix that up.

{{t 'general.home'}}
</Button>
{{#each fileManager.currentPath as |pathItem|}}
{{#if this.hasRootFolder }}
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 this is a bit out of scope for this PR, but I'm wondering if hasRootFolder is false, we shouldn't need to invoke the FileManager component at all?

Meaning, right now, this template is structured (in pseudo-code) like

<FileManager>
   {{#if hasRootFolder}}
      ...some file explorer stuff
      <div>
         <Button>Save</Button>
         <Button>Cancel</Button>
      </div>
   {{/if}}
</FileManager>

But I think we can avoid a few unneeded (and possibly prone to fail) network calls by structuring it like:

{{#if hasRootFolder}}
   <FileManager>
      ...some file explorer stuff

   </FileManager>
{{/if}}
<div>
   <Button>Save</Button>
   <Button>Cancel</Button>
</div>

I don't want to scope-creep this PR, so I can make these changes in a separate PR if you would prefer!

Copy link
Member Author

Choose a reason for hiding this comment

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

Lemme try it real quick, see how it goes.

Copy link
Member Author

Choose a reason for hiding this comment

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

"real quick" == 3 hours apparently

@felliott felliott force-pushed the feature/fix-computing-names branch from bbe7889 to 3d4eaf3 Compare December 31, 2024 01:16
@felliott felliott requested a review from futa-ikeda December 31, 2024 01:28
 * Add hasRootFolder getter to detect if root folder selector should
   be shown.

 * Rename `selectedAccount` to `authorizedAccount` to match the
   invocation syntax.
 * Responding to code review, improve disableSaveButton check

 * Responding to code review, {{#if}} around the entire FileManager
@felliott felliott force-pushed the feature/fix-computing-names branch from 3d4eaf3 to 6535fdf Compare January 2, 2025 13:16
@felliott
Copy link
Member Author

felliott commented Jan 2, 2025

Rebased onto the current commit, and added checks for configured computing addons.

@adlius adlius merged commit 3d910e0 into CenterForOpenScience:feature/addon-services Jan 2, 2025
9 checks passed
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