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: Add Gitea / Forgejo support #98

Merged
merged 1 commit into from
Dec 29, 2022
Merged

feat: Add Gitea / Forgejo support #98

merged 1 commit into from
Dec 29, 2022

Conversation

jacobkiers
Copy link
Contributor

This adds support for gitea and Forgejo, a friendly fork of Gitea.

This adds support for gitea and Forgejo, a friendly fork of Gitea.
@jacobkiers
Copy link
Contributor Author

This is a direct copy of the gitlab backend, with some small changes for Gitea.

@jaemk
Copy link
Owner

jaemk commented Dec 29, 2022

Thanks! This looks good to me. Were you able to confirm it works against a gitea and forgejo server? I don't have one I can test against myself

@jacobkiers
Copy link
Contributor Author

jacobkiers commented Dec 29, 2022

Yes, I tested it against my own Gitea instance. I have not tested it against Forgejo, but that is a very recent friendly fork of Gitea, so there is no reason why it would not work.

Here is the integrating code: https://code.kiers.eu/newsletter-to-web/newsletter-to-web/commit/7c5e97157149b5bda1f5f05241470614ffac3584#diff-1f171367c06a25802278385619fa0a352f08ca77

Some sample outputs:

  • Public project: succeeds.
  • Private project, no auth token: fails as expected
  • Private project, with auth token: works as expected

I just flipped the private project flag for this test.

Public project, no authentication (succeeds):

cargo run --  update
    Updating crates.io index
   Compiling newsletter-to-web v0.2.1 (/home/jk/src/newsletter-to-web)
    Finished dev [unoptimized + debuginfo] target(s) in 5.04s
     Running `target/debug/newsletter-to-web update`
Checking target-arch... x86_64-unknown-linux-gnu
Checking current version... v0.2.1
Checking latest released version... v0.2.2
New release found! v0.2.1 --> v0.2.2
New release is compatible

newsletter-to-web release status:
  * Current exe: "/home/jk/src/newsletter-to-web/target/debug/newsletter-to-web"
  * New exe release: "newsletter-to-web-x86_64-unknown-linux-gnu"
  * New exe download url: "https://code.kiers.eu/attachments/e0019427-1929-4e38-9fee-f58cb21e19d8"

The new release will be downloaded/extracted and the existing binary will be replaced.
Do you want to continue? [Y/n] n
Error: Update("Update aborted")

Private project, no authentication (fails as expected):

cargo run --  update
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/newsletter-to-web update`
Checking target-arch... x86_64-unknown-linux-gnu
Checking current version... v0.2.1
Checking latest released version... Error: Network("api request failed with status: 404 - for: \"https://code.kiers.eu/api/v1/repos/newsletter-to-web/newsletter-to-web/releases\"")

Private project, with auth token (works as expected):

cargo run --  update
   Compiling newsletter-to-web v0.2.1 (/home/jk/src/newsletter-to-web)
    Finished dev [unoptimized + debuginfo] target(s) in 4.55s
     Running `target/debug/newsletter-to-web update`
Checking target-arch... x86_64-unknown-linux-gnu
Checking current version... v0.2.1
Checking latest released version... v0.2.2
New release found! v0.2.1 --> v0.2.2
New release is compatible

newsletter-to-web release status:
  * Current exe: "/home/jk/src/newsletter-to-web/target/debug/newsletter-to-web"
  * New exe release: "newsletter-to-web-x86_64-unknown-linux-gnu"
  * New exe download url: "https://code.kiers.eu/attachments/e0019427-1929-4e38-9fee-f58cb21e19d8"

The new release will be downloaded/extracted and the existing binary will be replaced.
Do you want to continue? [Y/n] n
Error: Update("Update aborted")

@jaemk
Copy link
Owner

jaemk commented Dec 29, 2022

Thanks!

@jaemk jaemk merged commit 748443c into jaemk:master Dec 29, 2022
@jaemk
Copy link
Owner

jaemk commented Dec 29, 2022

released in 0.33.0

@jacobkiers
Copy link
Contributor Author

Thanks you as well for releasing a new version so quickly!

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