ubiquity-os / plugins-wishlist

0 stars 2 forks source link

Preview deployments for Workers #36

Closed gentlementlegen closed 3 weeks ago

gentlementlegen commented 1 month ago

This is not a specific plugin but a nice-to-have features for plugin Workers.

Currently when developing it's quite easy to switch to a different Action branch for testing a new feature, by specifying the @branch within the configuration.

However, workers do not benefit from this and always have to be deployed from the main branch to be tested. This makes development more tedious than it has to be, even worse when testing other people pull-requests.

What would be nice is to get a preview URL base on the latest commit of the branch the user is working on.

It would also be important to cleanup the preview deployments as they would pollute Cloudflare heavily.

A naming pattern could be: <plugin-name>.<username>.<branch>.<hash> to find them easily and know what they refer to. We could also have the deployed url displayed in the Action results to be found easily, and without the need to access Github token because we do not publish in the pull-request thread.

This probably can be implemented as an Action, which we could also put inside the plugin-template so new plugins can benefit from this right away.

ubiquibot[bot] commented 1 month ago

@gentlementlegen the deadline is at 2024-08-21T09:07:12.467Z

0x4007 commented 1 month ago

What would be nice is to get a preview URL base on the latest commit of the branch the user is working on.

Your technical specification does not offer clarity into how you plan to implement this. Otherwise I would suggest just doing local development (can you use localhost in the bot config?) and then finally doing a deploy?

gentlementlegen commented 1 month ago

I think an Action can handle it all, we already have the Cloudflare deployment set up. The idea is that instead of having every time to clone the user's branch, set it up locally etc. we could just try it through the URL. That would also allow testing with multiple versions without having them merged on the main branch all the time (every time I test someone else's PR I need to force push my main branch on my org). And for safety we could easily test any deployment with the sandbox repo as well.

0x4007 commented 1 month ago

We could just ask that contributors allow us to test on their own bot on their own org. No extra work needed.

gentlementlegen commented 1 month ago

Yes but still we cannot handle multi branch on our own repos, so we always need to deploy the main branch, which is what I am trying to solve here 😄

gentlementlegen commented 3 weeks ago

If this gets merged, we might want to have this running on our Worker plugins. Could be helpful to get https://github.com/ubiquity/ts-template/pull/56 to help with this.

ubiquity-os[bot] commented 3 weeks ago

[ 388.68 WXDAI ]

@gentlementlegen
Contributions Overview
View Contribution Count Reward
Issue Task 1 300
Issue Specification 1 62.4
Issue Comment 3 26.28
Review Comment 8 0
Conversation Incentives
Comment Formatting Relevance Reward
This is not a specific plugin but a nice-to-have features for pl…
62.4
content:
  p:
    symbols:
      \b\w+\b:
        count: 198
        multiplier: 0.1
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 2
        multiplier: 0.1
    score: 5
multiplier: 3
1 62.4
I think an Action can handle it all, we already have the Cloudfl…
19.6
content:
  p:
    symbols:
      \b\w+\b:
        count: 97
        multiplier: 0.2
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 1
multiplier: 1
0.9 17.64
Yes but still we cannot handle multi branch on our own repos, so…
6
content:
  p:
    symbols:
      \b\w+\b:
        count: 30
        multiplier: 0.2
    score: 1
multiplier: 1
0.8 4.8
If this gets merged, we might want to have this running on our W…
6.4
content:
  p:
    symbols:
      \b\w+\b:
        count: 32
        multiplier: 0.2
    score: 1
multiplier: 1
0.6 3.84
Resolves https://github.com/ubiquibot/plugins-wishlist/issues/36 …
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 22
        multiplier: 0
    score: 1
  h2:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0
    score: 1
  ul:
    symbols:
      \b\w+\b:
        count: 45
        multiplier: 0
    score: 1
  li:
    symbols:
      \b\w+\b:
        count: 35
        multiplier: 0
    score: 1
multiplier: 0
0.3 -
Good point, I didn't think of this scenario. I guess we should a…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 87
        multiplier: 0.2
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
It deploys on the owners account meaning pull-requests won't dep…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 69
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
@0x4007 It deploys on branch created / pushed to. When a user op…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 74
        multiplier: 0.2
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
The contributor has to setup its own Cloudflare for this to work…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 25
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
Hopefully no one names it this way, but we surely can have plent…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 42
        multiplier: 0.2
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
Had to make modifications because of [RFC 1035](https://datatrac…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 12
        multiplier: 0.2
    score: 1
  a:
    symbols:
      \b\w+\b:
        count: 2
        multiplier: 0.2
    score: 1
multiplier: 0
1 -
Opened https://github.com/ubiquibot/plugin-template/issues/18 to…
0
content:
  p:
    symbols:
      \b\w+\b:
        count: 36
        multiplier: 0.2
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.2
    score: 1
multiplier: 0
1 -

[ 19.42 WXDAI ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Comment 2 2.82
Review Comment 6 16.6
Conversation Incentives
Comment Formatting Relevance Reward
Your technical specification does not offer clarity into how you…
3.6
content:
  p:
    symbols:
      \b\w+\b:
        count: 36
        multiplier: 0.1
    score: 1
multiplier: 1
0.6 2.16
We could just ask that contributors allow us to test on their ow…
2.2
content:
  p:
    symbols:
      \b\w+\b:
        count: 22
        multiplier: 0.1
    score: 1
multiplier: 1
0.3 0.66
Looks like it works according to your QA
0.8
content:
  p:
    symbols:
      \b\w+\b:
        count: 8
        multiplier: 0.1
    score: 1
multiplier: 1
1 0.8
We can only have [100 workers](https://developers.cloudflare.com…
9.5
content:
  p:
    symbols:
      \b\w+\b:
        count: 92
        multiplier: 0.1
    score: 1
  a:
    symbols:
      \b\w+\b:
        count: 3
        multiplier: 0.1
    score: 1
multiplier: 1
1 9.5
How does it deploy on the contributors account? I just wrote a n…
1.6
content:
  p:
    symbols:
      \b\w+\b:
        count: 16
        multiplier: 0.1
    score: 1
multiplier: 1
1 1.6
I don't understand how it could possibly post on another Cloudfl…
1.5
content:
  p:
    symbols:
      \b\w+\b:
        count: 15
        multiplier: 0.1
    score: 1
multiplier: 1
1 1.5
The answer is that the contributor sets the key in their fork's …
2.6
content:
  p:
    symbols:
      \b\w+\b:
        count: 26
        multiplier: 0.1
    score: 1
multiplier: 1
1 2.6
That is a crazy branch name.
0.6
content:
  p:
    symbols:
      \b\w+\b:
        count: 6
        multiplier: 0.1
    score: 1
multiplier: 1
1 0.6

[ 0.7 WXDAI ]

@whilefoo
Contributions Overview
View Contribution Count Reward
Review Comment 2 0.7
Conversation Incentives
Comment Formatting Relevance Reward
that's super useful!
0.1
content:
  p:
    symbols:
      \b\w+\b:
        count: 4
        multiplier: 0.1
    score: 1
multiplier: 0.25
1 0.1
won't this grep match multiple lines for example [a sample confi…
0.6
content:
  p:
    symbols:
      \b\w+\b:
        count: 20
        multiplier: 0.1
    score: 1
  a:
    symbols:
      \b\w+\b:
        count: 3
        multiplier: 0.1
    score: 1
  code:
    symbols:
      \b\w+\b:
        count: 1
        multiplier: 0.1
    score: 1
multiplier: 0.25
1 0.6