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

Feat/config installer #13

Merged
merged 42 commits into from
Nov 21, 2024
Merged

Conversation

Keyrxng
Copy link
Contributor

@Keyrxng Keyrxng commented Nov 9, 2024

Resolves #3
Requires #11 and #12 (reviewing those could be skipped and focus placed just on this PR)

  • Listing all plugins from ubiquity-os-marketplace and grabbing manifests
  • Login with GitHub App: fetch user orgs with app installs.
  • Select org: Select config: Select Plugin
  • Update configuration based on manifest values
  • Save to local and optionally push to GitHub
  • Can build multiple plugins before pushing to GitHub

Still buggy with some plugins I need to inspect the more complex ones and handle their configs better but this shows what it looks like with a plugin with a medium size config. It should be ready to over the next day.

@zugdev Idk if you want to work your magic after this is merged, branch off and PR against dev or into this before that or just review and create a spec for what's needed? What do you think?


We can still build this UI with the ability to read from a query param directly too but it's a cleaner approach housing them all imo.

  • I'm thinking pull the plugin README and display it beside the configuration?
  • breadcrumbs would be good to jump back and re-select plugin, config, org.
  • it's pretty verbose but additional details in the manifest for each prop. In .ts we use JSDoc comments on input props and it fills the IDE. This would be handy af if we had a workflow to parse these and write them to the manifest which could be read on this UI: e.g requiredLabelsToStart without defaults might be confusing to a partner

QA:

plugin-installer-demo.mp4

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 9, 2024

  1. manifest.name should reflect the repository name so we can match it to the worker/action url
  2. all plugin manifests rendering without error.
  3. redesigning the UI to accommodate the extensive configs should be spec'd
  4. I've achieved the spec as it exists for this task, following some minor tweaks to config prop options this is review ready.

QA with official plugin URL:

demo-sbs.mp4

@zugdev I saw you say that this codebase is your scope, perhaps you want to start reviewing my PRs as I think 0x4007 is busy.

@Keyrxng Keyrxng mentioned this pull request Nov 9, 2024
.cspell.json Outdated Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
.eslintrc Outdated Show resolved Hide resolved
.github/CODEOWNERS Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
build/esbuild-build.ts Outdated Show resolved Hide resolved
@rndquu rndquu self-requested a review November 18, 2024 09:26
@rndquu
Copy link
Member

rndquu commented Nov 18, 2024

@Keyrxng

You use your UbiquityOS instance because we check for installs against the authenticated user's organizations that they own.

If partner doesn't have the UbiquityOS app installed anywhere (which is true for new partners) then he will not be able to install the config, correct?

Overall I still don't understand why we should mess with github app auth instead of oauth which is already working fine in work.ubq.fi.

Finer control over scopes and gets us access to potentially private orgs too.

work.ubq.fi also has access to private repos with oauth

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 18, 2024

If partner doesn't have the UbiquityOS app installed anywhere (which is true for new partners) then he will not be able to install the config, correct?

That was the intention yeah

Overall I still don't understand why we should mess with github app auth instead of oauth which is already working fine in work.ubq.fi. work.ubq.fi also has access to private repos with oauth

You can't check installs using an OAuth app as they are not installable and it felt right to track using the official instance install. If we wanted OAuth for access and then confirm the installs after we'd need to auth as the app via clientId/secret or appId/privateKey.


I've refactored OAuth to use an OAuth app, I have inlined the permissions required and tested things and they work.

  1. No install check, we are just listing the user's orgs.
  2. Only ubq-testing is showing for me so I continue to assume only orgs that they own will appear.
  3. I QA'd only with my OAuth app and things went smooth, I expect no difference from the OAuth app we use for work.ubq

@rndquu
Copy link
Member

rndquu commented Nov 19, 2024

@Keyrxng Trying to add the https://github.com/ubiquity-os-marketplace/command-wallet plugin to this organization. Getting the Error pushing config to GitHub: TypeError: source is not a string error:
Screenshot 2024-11-19 at 11 05 36

Does this PR create a new .ubiquity-os repository for new partners?

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 19, 2024

Does this PR create a new .ubiquity-os repository for new partners?

Sorry no it didn't, I assumed that would be part of the kernel setup steps but I have added logic to create the config repo now.

1119.mp4

@rndquu rndquu requested review from rndquu and removed request for rndquu November 19, 2024 15:00
@rndquu
Copy link
Member

rndquu commented Nov 19, 2024

I have added logic to create the config repo now.

Awesome, works fine.

@Keyrxng Could you update the readme file and remove github app related setup instructions?

The Empty String Check workflow is failing but that's false positive, added ubiquity/ts-template#82.

@gentlementlegen
Copy link
Member

Tested, works, that's cool.

Some details that would be worth a change later:

  • the generated configuration for start | stop looked like this
plugins:
  - uses:
      - plugin: https://ubiquity-os-command-start-stop-development.ubiquity.workers.dev
        with:
          reviewDelayTolerance: 1 Day
          taskStaleTimeoutDuration: 30 Days
          startRequiresWallet: true
          maxConcurrentTasks:
            member: 10
            contributor: 2
          assignedIssueScope: org
          emptyWalletText: Please set your wallet address with the /wallet command first
            and try again.
          rolesWithReviewAuthority:
            - COLLABORATOR
            - OWNER
            - MEMBER
            - ADMIN
          requiredLabelsToStart: []

Maybe it would be safer to wrap string values with quotes

  • On a 32 inch screen, it feels like a lot of space is wasted (c.f. screenshot)
image

cy.get("body").should("exist");
cy.get("h1").should("exist");
});
it("todo", () => {});
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't the error test be more relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was failing for some reason so I just removed it as it was a no-op either way. Minimal tests will be added in #19

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 21, 2024

Maybe it would be safer to wrap string values with quotes

I'm not so sure. I'm using YAML and it states "Passes all of the [yaml-test-suite](https://github.com/yaml/yaml-test-suite) tests" which is the official YMAL test suite as far as I can tell.

I'd have to modify the package (I think) in order to wrap in quotes but if you feel we should, can we task it separately?

On a 32 inch screen, it feels like a lot of space is wasted (c.f. screenshot)

Agreed I intentionally left CSS alone as much as possible and hoped to have it spec-ed but will be addressed in #19.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 21, 2024

@Keyrxng Could you update the readme file and remove github app related setup instructions?

I did this here aba5a19 and it includes OAuth app terminology now but the process is still the same for setup.

@rndquu
Copy link
Member

rndquu commented Nov 21, 2024

@Keyrxng Could you update the readme file and remove github app related setup instructions?

I did this here aba5a19 and it includes OAuth app terminology now but the process is still the same for setup.

Could you fix the failing knip ci?

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 21, 2024

My bad I didn't notice that but also weird that it failed due to the plugin-sdk

@gentlementlegen
Copy link
Member

Maybe it would be safer to wrap string values with quotes

I'm not so sure. I'm using YAML and it states "Passes all of the [yaml-test-suite](https://github.com/yaml/yaml-test-suite) tests" which is the official YMAL test suite as far as I can tell.

I'd have to modify the package (I think) in order to wrap in quotes but if you feel we should, can we task it separately?

On a 32 inch screen, it feels like a lot of space is wasted (c.f. screenshot)

Agreed I intentionally left CSS alone as much as possible and hoped to have it spec-ed but will be addressed in #19.

If that's not causing any issue then don't sweat on it, I just wanted to make sure. Got it, good to go.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 21, 2024

Got it, good to go.

I cannot merge, so whenever you are ready is good.

@rndquu rndquu merged commit cf8e6da into ubiquity-os:main Nov 21, 2024
4 of 5 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.

Create add/remove config logic
5 participants