LPGhatguy / aftman

Aftman, the prodigal sequel to Foreman
MIT License
157 stars 16 forks source link

Add Support for GitHub Personal Access Tokens #18

Closed sasial-dev closed 2 years ago

sasial-dev commented 2 years ago

Fixes #7

This is my first time using rust, so please let me know if anything needs to be changed as i'm really new to the language!

This PR consists of:

Out of scope for this PR are:

* While (hopfully) no one will hit that rate limit, it's nice to have to option of so many more requests. The first usecase I could think of was for a new user downloading releases for lots of tools It has been confirmed users do hit the ratelimit.

sasial-dev commented 2 years ago

The biggest thing is reading the manifest to check for the token before using aftman add/aftman run. I wasn't sure how/where you wanted me to read the manifest - am looking for your direction here before so I don't do it in the wrong place

sasial-dev commented 2 years ago

Code-wise, this looks much better!

sasial-dev commented 2 years ago

Note that the CI failed due to warning: add_token not being implmented yet, let me know what course of action you'd like me to take (leaving it as deadcode or implmenting a CLI command)

LPGhatguy commented 2 years ago

Note that the CI failed due to warning: add_token not being implmented yet, let me know what course of action you'd like me to take (leaving it as deadcode or implmenting a CLI command)

CI failed because you didn't run rustfmt! You should turn on "format on save" in your editor so that code gets correctly formatted.

ok-nick commented 2 years ago

This PR is definitely useful, I've hit the 60 rate limit via CI.

filiptibell commented 2 years ago

I can second how useful this would be for us, right now we're unable to completely manage our tools in CI using neither foreman nor aftman. Foreman does not match release artifacts properly for some third party tools we need (such as sentry-cli) and has issues with long-running processes. Aftman is only missing support for private tools/auth. We could completely get rid of our self-hosted and custom setup runners whenever this PR goes through :tada:

sasial-dev commented 2 years ago

Thanks again @filiptibell! I actually tried and pushed commits implimenting both options here! I finally decided on passing the whole manifest for future compatibility (some sources may need more than 1 field etc) and it felt like a cleaner soulution :)