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

Add support for Gitea #51

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Turbocube644
Copy link

Support for Gitea. Code is based on the one for Gitlab to keep the Code Style and Approach.
Also the support for Gitlab had about the same scope as for Gitea.

@LecrisUT
Copy link

LecrisUT commented Apr 9, 2022

Can I ask how you managed to compile this repository? I have tried the README instructions, but the libraries seem to be missing

@Turbocube644
Copy link
Author

Turbocube644 commented Apr 19, 2022

@LecrisUT
Copy link

Thank you. So instead of pointing it to the libraries in the runtime TeamCity, I can point them to those? Not sure what the appropriate gradle.properties would be to set it up like that. Fortunately the repository was pushed with the release branches for each version, so now I can prototype on my 2021.2 release.

@Turbocube644
Copy link
Author

So instead of pointing it to the libraries in the runtime TeamCity, I can point them to those?

Yes

Not sure what the appropriate gradle.properties would be to set it up like that.

Is used the following:

TeamCityLibs=../../TeamCity/webapps/ROOT/WEB-INF/lib/
TeamCityTestLibs=../../TeamCity/devPackage/tests
PluginVersion=99712
TeamCityVersion=2021.2.3

Using the gradle.properties you do not need to use the long gradle build command.
Apparently the TeamCityVersion needs to match. PluginVersion needs to be higher than the version you intend to overwrite. For TeamCityVersion=2021.2.3 all Plugins have the version 99711 (indicated by the file BUILD_99711 in the downloaded API or by taking a look at the plugin page of your running TeamCity Server instance). Therefore I just chose version 99712.

@Turbocube644 Turbocube644 force-pushed the master branch 2 times, most recently from 27f39e8 to 3e7ff11 Compare May 27, 2022 15:15
@markusstephanides
Copy link

Hi, nice work! When will this be merged?

@ughyg
Copy link

ughyg commented Oct 17, 2022

Can't wait to be merged. Thanks for this job.

@TimberBro
Copy link

This PR would be extremely helpful. Any chance that it will be merged?

@CanisHelix
Copy link

@Turbocube644 Thanks for this, really wish JetBrains would bring this in though.

@TimberBro
Copy link

TimberBro commented Jul 8, 2023

Tried to build this plugin to test it internally.
My steps:

  1. Pulled latest version of your fork repo
  2. Downloaded latest distribution of Teamcity, using URL from previous comments
  3. Set my gradle.properties as
TeamCityLibs=../../TeamCity/webapps/ROOT/WEB-INF/lib/
TeamCityTestLibs=../../TeamCity/devPackage/tests
PluginVersion=99712
TeamCityVersion=2021.2.3
  1. Run gradle clean build
  2. Get around 100 errors, that says, that some packages are missing.

For example, the error says, that I don't have package to import
import jetbrains.buildServer.vcshostings.http.credentials.HttpCredentials;
I couldn't find it in distribution ether. Even OpenAPI doc doesn't have information about this package.
Could anybody hint, what am I missing?

@Turbocube644
Copy link
Author

@TimberBro The most recent commit is based on the commit which was used for TeamCity 2023.05

Therefore, the grade.properties need to look something like this:

TeamCityLibs=../../TeamCity/webapps/ROOT/WEB-INF/lib/
TeamCityTestLibs=../../TeamCity/devPackage/tests
PluginVersion=1234567
TeamCityVersion=2023.05

The PluginVersion needs to be higher thant the corresponding TeamCity Build Version (129203 for TeamCity 2023.05). You can choose any number, so 999999 would work for quite a while for example.

@TimberBro
Copy link

@Turbocube644 Thanks for your reply!
For some strange reason, not all libs from TeamCityLibs were found by gradle and that was the root cause of my problem.
After your answer I returned to my VM again, then build plugin for 2023.05 first try.

@gpby
Copy link

gpby commented Oct 19, 2023

Are there any chances for PR to be merged?

@chylex
Copy link

chylex commented Jan 17, 2024

I found https://www.youtube.com/watch?v=R-BPNomdkBE which configured Commit Status Publisher with the GitHub integration but using the Gitea API endpoint, so I guess GitHub and Gitea have the same/similar APIs? Haven't tried it myself yet, but if it works without major issues then it would be a good workaround until this is merged.

@Turbocube644 Turbocube644 force-pushed the master branch 2 times, most recently from 3541679 to b6f1204 Compare January 25, 2024 12:31
@Turbocube644
Copy link
Author

I found https://www.youtube.com/watch?v=R-BPNomdkBE which configured Commit Status Publisher with the GitHub integration but using the Gitea API endpoint, so I guess GitHub and Gitea have the same/similar APIs? Haven't tried it myself yet, but if it works without major issues then it would be a good workaround until this is merged.

Gitea becomes more and more compatible with Github in General. With Gitea 1.21 the statuses seems to be same (before gitea had warning and from 1.19 to 1.120 running)

@CanisHelix
Copy link

@Turbocube644 What version of Gradle/Java are you building with?

I could build for 2023.05 with Gradle 6.9.1 and Java 17.0.9 without issue, but now for 2023.11 I had to upgrade Gradle to 7.6.4 due to

root in commit-status-publisher-gitea on  master via 🅶 v6.9.1 via ☕ v17.0.9
❯ gradle clean build -PTeamCityTestLibs=/root/JetBrains/TeamCity.2023.11/devPackage/tests -PTeamCityLibs=/root/JetBrains/TeamCity.2023.11/webapps/ROOT/WEB-INF/lib -PTeamCityVersion=2023.11 -PPluginVersion=129205

FAILURE: Build failed with an exception.

* Where:
Settings file '/root/JetBrains/commit-status-publisher-gitea/settings.gradle'

* What went wrong:
Could not compile settings file '/root/JetBrains/commit-status-publisher-gitea/settings.gradle'.
> startup failed:
  General error during semantic analysis: Unsupported class file major version 61

  java.lang.IllegalArgumentException: Unsupported class file major version 61
        at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
        at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:177)
        at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:163)
        at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:284)

Now with Gradle 7.6.4 I get this error:

root in commit-status-publisher-gitea on  master via 🅶 v6.9.1 via ☕ v17.0.9
❯ gradle clean build -PTeamCityTestLibs=/root/JetBrains/TeamCity.2023.11/devPackage/tests -PTeamCityLibs=/root/JetBrains/TeamCity.2023.11/webapps/ROOT/WEB-INF/lib -PTeamCityVersion=2023.11 -PPluginVersion=129205 --stacktrace

FAILURE: Build failed with an exception.

* Where:
Build file '/root/JetBrains/commit-status-publisher-gitea/build.gradle' line: 44

* What went wrong:
A problem occurred evaluating root project 'commit-status-publisher'.
> Configuration with name 'runtime' not found.

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'commit-status-publisher'.
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:133)
        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:79)

@Turbocube644
Copy link
Author

I have updated the support for 2024.07.1
I had to revert commit da579c3 from 6th February this year as the changes do not work (the maven repo from jetbrains seems no to be available). Additionally, the README.md is not updated for that change either.

As there is no API Version for 2024.07.1, I used 2024.07 (can be checked at https://download.jetbrains.com/teamcity-repository/org/jetbrains/teamcity/server-api/). Therefore TeamCity itself still needs to be downloaded from https://download-cdn.jetbrains.com/teamcity/TeamCity-{202X.Y}.tar.gz and put alongside the checkout.

Additionally, I disabled the test as they would refuse to compile.

For gradle, I just used an up to date IntelliJ (6.9.1).

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.

8 participants