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: Allow providing manual branch name #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

srevinsaju
Copy link
Contributor

Currently, go-appimage does not allow to provide the branch / tag name / channel from where
github releases can be updated (updateinformation). This is useful for releasing apps to, beta, nightly channels, by setting APPIMAGETOOL_GH_BRANCH_DEPLOY environment variable to the required branch/channel name.

Use case, in the Firefox-AppImage, I would like to maintain Beta, Nightly, Stable, ESR Releases in a single repository. I could achieve this by doing something like this

export APPIMAGETOOL_GH_BRANCH_DEPLOY=nightly
./appimagetool*.AppImage AppDir

I am open to changes / feel free to close this PR if it seems redundant

Currently, go-appimage does not allow to provide the branch / tag name / channel from where
github releases can be updated (updateinformation). This is useful for releasing apps to, `beta`, `nightly` channels, by setting APPIMAGETOOL_GH_BRANCH_DEPLOY environment variable to the required branch/channel name.
@srevinsaju
Copy link
Contributor Author

@probonopd kindly provide your suggestions 😇

@srevinsaju
Copy link
Contributor Author

srevinsaju commented Oct 22, 2020

I guess, it would be better to rename the environmental name

APPIMAGETOOL_GH_BRANCH_DEPLOY -> APPIMAGETOOL_GH_DEPLOY_CHANNEL

to make it more meaningful

@probonopd
Copy link
Owner

Thanks @srevinsaju. Were you able to test this fully, including that updates work when using multiple different channels?

@srevinsaju
Copy link
Contributor Author

srevinsaju commented Oct 22, 2020

I tested it here, sorry for the repository name 😄

You may see the ./appimagetool*.AppImage sections as the last output

for easier reference:

before

AppRun unsupported custom build


2020/10/22 12:52:55 ELF section .upd_info offset 175784 length 1024


[103 104 45 114 101 108 101 97 115 101 115 45 122 115 121 110 99 124 115 114 101 118 105 110 115 97 106 117 124 103 111 45 97 112 112 105 109 97 103 101 116 101 115 116 115 116 101 115 116 115 116 101 115 116 101 115 116 101 115 116 115 124 108 97 116 101 115 116 124 97 112 112 105 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

Which is as a string:

gh-releases-zsync|srevinsaju|go-appimageteststeststestestests|latest|appimagetool-*-x86_64.AppImage.zsync

===========================================================

after exporting the env var

AppRun unsupported custom build

2020/10/22 12:55:12 ELF section .upd_info offset 175784 length 1024



[103 104 45 114 101 108 101 97 115 101 115 45 122 115 121 110 99 124 115 114 101 118 105 110 115 97 106 117 124 103 111 45 97 112 112 105 109 97 103 101 116 101 115 116 115 116 101 115 116 115 116 101 115 116 101 115 116 101 115 116 115 124 110 105 103 104 116 108 121 124 97 112 112 105 109 97 103 101 116 111 111 108 45 42 45 120 56 54 95 54 52 46 65 112 112 73 109 97 103 101 46 122 115 121 110 99 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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saju|go-appimageteststeststestestests|nightly|appimagetool-*-x86_64.AppImage.zsync

===========================================================

@probonopd
Copy link
Owner

That looks good. Could you perform an end-to-end test, actually updating, when you have more than one channel?

@srevinsaju
Copy link
Contributor Author

I did not understand, did you mean to implement this in Firefox-AppImage or a similar repository, so that you will be able to see?

@probonopd
Copy link
Owner

Yes, if that's not too much to ask :-)

@srevinsaju
Copy link
Contributor Author

srevinsaju commented Oct 22, 2020

Ok, may I know if I would be able to download the build artifact from Travis CI? Because, it would make things easier for me 😄 , if not, I will try to build go-appimage on an old system

@srevinsaju
Copy link
Contributor Author

Ok, I am porting the scripts/build.sh to GitHub actions, I am not sure if you are its fan, but I will try it on my fork 😄

@probonopd
Copy link
Owner

GitHub Actions is something that I'd like to support anyway. When I had started working on go-appimage it was not there yet (or at least I had no clue about it at that time).

@srevinsaju
Copy link
Contributor Author

Sure, I have created a go-appimage GitHub Action to build every commit and provide an artifact for download for PRs with their base branch as dev on https://github.com/srevinsaju/go-appimage

Regarding adding it to Firefox-AppImage, because of #68 I will not be adding this yet, but I would try to fix #68 before this, as its quite important. Its the only blocker which I see now, which prevents me from using go-appimagetool. Until then, I will create nightly and beta builds of go-appimagetool on my fork as a demo. Right now, you can see the releases for x86_64 and i386 are generated using your script.

@probonopd
Copy link
Owner

Good. Just ping me when you think everything is end-to-end tested well enough that you consider this safe to merge. Thanks!

@srevinsaju
Copy link
Contributor Author

srevinsaju commented Oct 23, 2020

@probonopd Done!, you can see this Firefox repository and its channels.

@srevinsaju srevinsaju marked this pull request as ready for review October 23, 2020 10:52
@probonopd
Copy link
Owner

probonopd commented Oct 24, 2020

Thank you very muich @srevinsaju for the implementation and testing.

Thinking about it some more, can we do without the APPIMAGETOOL_GH_BRANCH_DEPLOY variable and use the variables that GitLab CI/GitHub Actions/Travis CI automatically set when a build is run for a branch? This way, the tool would do the right thing automatically without the need for the user to understand or do anything special...

For this tool, my objective is zero need (and ability) to configure anything. Because in my experience, anything that can be configured will lead to complexity, and issueseventually. I love tools that just do their job without the user having to configure anything manually. The tool should know to do the right thing without flags, environment variables etc. (We are not quite there yet but that is the direction I would like to take with this tool.)

@srevinsaju
Copy link
Contributor Author

@probonopd I understand your idea, but I feel that the core tools should be extensively configurable, and end-users should never use low level tools like appimagetool, but instead, they should use higher level tools like pkg2appimage, or appimage-builder. Restricting the ability to configure low level applications makes it almost impossible to configure them on higher level helper tools (unless we fork go-appimage)

Regarding branches, actually, the right term I should have used is channel. For example, Firefox-AppImage is built on the master branch and releases are created as tags. We cannot retrieve the tags from gh actions, gitlab or travis because we set them after we build the executable right? Moreover, I would consider this one environment variable as protected variable, i.e. the user should only set this if they 'really know what they're doing™'. I would suggest printing a warning message to stdout, what do you suggest?

@probonopd
Copy link
Owner

probonopd commented Oct 24, 2020

The name appimagetool in go-appimage is a misnomer: It is not the same low-level tool as the old appimagetool in https://github.com/AppImage/AppImageKit. Instead, it is a very high-level tool intended to do everything, including uploading, so that the user has zero chance to mess anything up. If something is not working when using this tool, then the tool itself is to be blamed and needs to be fixed, rather the user trying to do random workarounds that do more harm than good.

I guess my bad naming choice has led to a lot of misconceptions, also for other community members.

Let's come up with a better name for this tool, something that conveys "High-level fully-automagic zero-configuration AppImage all in one creation tool".

@srevinsaju
Copy link
Contributor Author

oh I see. I thought its a new rewrite of the old appimagetool, which was supposed to be the low-level tool which was supposed to just convert an AppDir to appimagetool.

@probonopd
Copy link
Owner

It isn't - it's a naming screwup. (It started out being that, but then I just kept coding, adding more and more functionality toward a full blown "do it all" tool, so the name no longer is a good match.)

@srevinsaju
Copy link
Contributor Author

We could ask for suggestions on a new issue for a cool new name. The community would be interested to provide some inputs, but this repository is less discoverable than AppImageKit, would this repository be moved some day?

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.

2 participants