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

Fix Gradle Wrapper Uprade (again) #2669

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

StefMa
Copy link
Contributor

@StefMa StefMa commented Sep 24, 2023

Lets go with this for now 🤓
I will not run tests, but you get at least informed about it via PRs.
A simple checkout PR_number and ./gradlew check or something should reveal if it works or not 😉

Better than nothing I would say.
Your token can also be updated later, in case this apporoach is getting too annoying. But I doubt it, because Gradle reelase are also not that often 🙃

@ILIYANGERMANOV
Copy link
Collaborator

Thank you @StefMa! Would this work? Let's test it^ I tried the fix the old Gradle wrapper upgrade by providing a GitHub PAT. Also, there are some issues with GitHub secrets, they are provided only when the run originates from the root Ivy Wallet.

What's required from my side to make this work? Btw, main is protected the gradle wrapper upgrade will work only if your automation knows how to raise a PR with the change. Direct pushes to main are prohibited.

@ILIYANGERMANOV
Copy link
Collaborator

To make it work, it needs to behave as Dependabot does: it raises a PR on which the CI runs, I can review and only if it works we merge it.

Copy link
Collaborator

@ILIYANGERMANOV ILIYANGERMANOV left a comment

Choose a reason for hiding this comment

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

Research and paste me a TL;DR; on how the Gradle upgrade plugin works. If it raises a PR, we're good to go and merge + enable the workflow. Otherwise, we need to find a way to make it raise PRs like Dependabot / Renovate.

@StefMa
Copy link
Contributor Author

StefMa commented Sep 25, 2023

Hey,

you can check out how it works for example in our SentryProguardGradlePlugin.
This is how our GH Actions looks like.
This is how a respective PR looks like.

As you see, the plugin, even if used the secrets.GITHUB_TOKEN, is able to create a PR in the name of the GitHub bot.

However, the PR will not run any tests.
I also don't know how to trigger those tests.
The reason for this is, that we are using the secrets.GITHUB_TOKEN.
This somehow prevents the PR to running tests.

However, since I also don't know how to create a proper PAT to make it work, I thought it make sense to go with the secrets.GITHUB_TOKEN for now so that you get a tleast "notified" via a PR about a new Gradle release.
Youy can then manually checkout the branch, do a local check and merge 🙃

Copy link
Collaborator

@ILIYANGERMANOV ILIYANGERMANOV left a comment

Choose a reason for hiding this comment

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

Got it - thanks for the explanation. The CI checks should work out of the box. I'll test it. Also, enabled the Gradle Upgrade workflow.

@ILIYANGERMANOV ILIYANGERMANOV merged commit a773a6d into Ivy-Apps:main Sep 25, 2023
5 checks passed
@ILIYANGERMANOV
Copy link
Collaborator

Hey @StefMa it the workflow failed:
https://github.com/Ivy-Apps/ivy-wallet/actions/runs/6309784232/job/17130401081

Error is sth like: GitHub Actions aren't permitted to create a PR.
Should we update it back to GitHub PAT. The one that I've provided in secrets is a for
https://github.com/ivywallet

which we use as a bot account.

@StefMa
Copy link
Contributor Author

StefMa commented Sep 26, 2023

Hey,
you can change this by updating the project settings:
https://github.com/Ivy-Apps/ivy-wallet/settings/actions

Screenshot 2023-09-26 at 10 34 40 AM

@ILIYANGERMANOV
Copy link
Collaborator

Thank you!!!
Screenshot_20230926_113728_Chrome

It's gray for some reason 😬

@StefMa
Copy link
Contributor Author

StefMa commented Sep 26, 2023

Seems you first have to allow it in the organisation 😁
https://stackoverflow.com/a/73155199

https://github.com/organizations/Ivy-Apps/settings/actions

@ILIYANGERMANOV
Copy link
Collaborator

OMG :D Thank you for great instructions, man! Fixed ✅ Let's see if it'll work tmrw

Screenshot 2023-09-26 at 12 02 20 Screenshot 2023-09-26 at 12 02 12

@ILIYANGERMANOV
Copy link
Collaborator

Hey @StefMa the workflow still fails but this time with a different error. That's good we're making progress 😀
https://github.com/Ivy-Apps/ivy-wallet/tree/main/.github/workflows

@StefMa
Copy link
Contributor Author

StefMa commented Sep 28, 2023

It's because the last time the branch with that name was already created and pushed, but they were unable to create the PR.

All you have to do is to delete the existing branch.

@ILIYANGERMANOV
Copy link
Collaborator

Got it. Deleted ✅ Let's see if it'll work tmrw

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