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

Refactor github action "Zwift script files updater" #64

Open
netbrain opened this issue Jan 19, 2024 · 13 comments
Open

Refactor github action "Zwift script files updater" #64

netbrain opened this issue Jan 19, 2024 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@netbrain
Copy link
Owner

Today the script files updater changes the current container image upon changes to the entrypoint script (aswell as maybe som other ones)

We should probably refactor this to trigger on changes to entrypoint and other scripts as well as the Dockerfile, where last mentioned will have to run a build from scratch instead of a simple commit.

@netbrain netbrain added the enhancement New feature or request label Jan 19, 2024
@sHedC sHedC self-assigned this May 28, 2024
@sHedC
Copy link
Collaborator

sHedC commented Jul 10, 2024

Any reason you used the testing trixie build? it is this that is failing they have broken some dependancies. I have re-built with bookworm locally and builds fine.

@netbrain
Copy link
Owner Author

Trixie at the time was the only variant that had the correct wine version.

@sHedC
Copy link
Collaborator

sHedC commented Jul 11, 2024

AHH ok I'll switch it to bookworm so it builds

@sHedC
Copy link
Collaborator

sHedC commented Jul 17, 2024

@netbrain
Created a temporary repo to try it out, have a look see what you think: https://github.com/sHedC/buildtest/actions
It uses releases to keep track of previous build incase of failure so what it does:

  1. Get last release, compare changes to head see if a build is needed and what type of build (release is filtered to find auto builds)
  2. If build required create a draft release (done early as build takes time)
  3. Build for Update/ Full, calls separate workflows and waits for success (or fail)
  4. on success commits drat release and cleans up any old draft releases

In addition it tries to generate auto release notes, so if you resolve an issue using a pull request it picks that up and documents it, otherwise just documents changes.

@netbrain
Copy link
Owner Author

Great work, I'll look into it someday (vacationing)

@sHedC
Copy link
Collaborator

sHedC commented Jul 18, 2024

Sounds like a nice long vacation hope you enjoy

@sHedC
Copy link
Collaborator

sHedC commented Aug 9, 2024

@netbrain - did you get a chance to review yet, I assume not.

@netbrain
Copy link
Owner Author

netbrain commented Aug 9, 2024

I did take a gander at it, but I think maybe you have to explain the benefits of this as opposed to what we have now in order for me to take a proper stand on it.

@sHedC
Copy link
Collaborator

sHedC commented Aug 9, 2024

Ok just started with re-configuring to refactor as this issue is about and to add trigger different build type based on what was changed.

So simply:

  1. If only script files updated then run update (not build, same as today)
  2. If files change that would require re-build, then trigger rebuild

Sounds simple but problem here is if the build fails then a future update may pick the wrong build, so idea was to create a tag and release for each successful build (with auto generated comments if possible)

Then updates would check the previous successful build with the current state and check the changed files to decide what build to run based on a successful release/ tag.

Currently it just does an update so if you update the docker file and a script you have to cancel the partial build and manually do a full build.

@netbrain
Copy link
Owner Author

netbrain commented Aug 9, 2024

Ok just started with re-configuring to refactor as this issue is about and to add trigger different build type based on what was changed.

So simply:

  1. If only script files updated then run update (not build, same as today)
  2. If files change that would require re-build, then trigger rebuild

Agreed, this is what I want to too.

Sounds simple but problem here is if the build fails then a future update may pick the wrong build, so idea was to create a tag and release for each successful build (with auto generated comments if possible)

A build may be successful, but fails when trying to start Zwift. How should we handle those? Manual intervention as it is today?

These tags, are these created manually then? Would like it to be as automatic as possible..

Then updates would check the previous successful build with the current state and check the changed files to decide what build to run based on a successful release/ tag.

Sounds complex, maybe unnecessarily so. Yes a new build today may fail and future builds may be based on this. But I think manual intervention for these might simpler than having to tag on every new release.

Currently it just does an update so if you update the docker file and a script you have to cancel the partial build and manually do a full build.

Yeah, would like to fix this shortcoming.

Would like to have a full build when Dockerfile changes. And for all other resources, run a update on change.

@sHedC
Copy link
Collaborator

sHedC commented Aug 9, 2024

A build may be successful, but fails when trying to start Zwift. How should we handle those? Manual intervention as it is today?

These tags, are these created manually then? Would like it to be as automatic as possible.

Tags are totally automatic, it creates a draft before starting then either deletes it if failes or completes a release if the build/ update is successful.

Sounds complex, maybe unnecessarily so. Yes a new build today may fail and future builds may be based on this. But I think manual intervention for these might simpler than having to tag on every new release.

Its complex but would be automatic, if there is a build failure and an update was done on another field that would not cause a full rebuild to fix it then it would know to do a full rebuild.

Yep its a full solution but yes also its more complex but only in the tagging the rest doing diffs would be as complex as what is there.

@sHedC
Copy link
Collaborator

sHedC commented Aug 9, 2024

Another option is to do what I do in another repo, I create a tag and release and its the release that triggers the build rather than just updating from every commit to main.

But I got the impression you wanted fully automated and I like the challenge.

@netbrain
Copy link
Owner Author

netbrain commented Aug 9, 2024

But I got the impression you wanted fully automated and I like the challenge.

Yes, i do, but not at all cost. I'll set of some time to look into it in greater detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants