ubiquity / ts-template

A template repository for all @ubiquity projects.
2 stars 24 forks source link

feat: refactor sync template workflow to work in a whitelist setting #78

Open zugdev opened 1 week ago

zugdev commented 1 week ago

Resolves #61

The sync workflow should only propose changes automatically on shared files between repos, I agree those include some of the workflows and ts settings. What I would propose is to enable manual workflow runs with input files too. This way if you want every repo that uses the template to receive a specific new file or to create an overwriting, but not too big PR, you can do it. I believe the AI analysis even though might help, would still need a thorough review and would not reduce any time overhead. I am not sure centralizing the sync workflow is a good idea, if so we would need another way to identify which repos implement the template, to only open PRs in those. If it is really needed we can have a repos list in the workflow, but I think having the sync template in this repo and skipping when it runs here is sufficient to deliver updates to all sync-template workflows across our implementations.

  1. Whitelist approach
  2. Allow for inputting specific files and running manually
  3. Adds sync-template to this repo and skips runs in ts-template
ubiquity-os-deployer[bot] commented 1 week ago
4ccb05c
afe768a
496fba1
8e53675
dd0c5f8
457cab9
c030c75
1977209
7df4c59
fc1c8c9
a68c37a
zugdev commented 1 week ago

Here is a QA, though it's failed because I don't have auth setup, you can see through the logs the modified files:

1. can create files with whitelist

2. can create files with additional manual input

3. can delete files

4. can modify files

zugdev commented 1 week ago

My solution enables individual repo configuration, the whitelist for this repo's sync-template.yml doesn't matter. What we should do is evaluate what files are shared between implementation and template and add it to the workflow in that specific implementation's repo. For example: in work.ubq.fi I know that the template's build workflow will work, so I should add it to the whitelist, on the other hand deploy.yml won't work - since we are implementing a KV setup. Another feature I've enabled is the manual synchronization with custom extra inputs, so:

  1. If you want to sync the whitelisted files/directories with the template at any time you can manually do that with empty arguments

  2. If you want to sync files/directories that aren't in the whitelist you can manually do that with paths separated by commas

Therefore a second step to this PR, is opening PRs in repos that implement ts-template with an initial configuration. I'll get started on that. It seems there a billion repos, what I could do to speed up is to initially setup the very obvious common files such as the .husky directory, and then with use we expand each repo's whitelist.

ubiquity-os[bot] commented 1 week ago

@zugdev, this task has been idle for a while. Please provide an update.

zugdev commented 3 days ago

I think this is a good default whitelist. The next steps are:

  1. Placing the sync-template workflow in all repos we want it to be.

  2. Installing the app and setting secrets in all repos

0x4007 commented 3 days ago

Probably should be all .github/* and all root config files at least.

zugdev commented 3 days ago

Probably should be all .github/* and all root config files at least.

I know that the deploy workflow shouldn't be in work.ubq.fi case, perhaps I can add a blacklist so we can add the entire .github dir but remove specific files in each repo with the blacklist.

ubiquity-os[bot] commented 14 hours ago

@zugdev, this task has been idle for a while. Please provide an update.