TripleHelixProgramming / HelixNavigator

A trajectory optimization-based GUI application for planning autonomous paths in FRC
13 stars 3 forks source link

access to Trajoptlib - Personal access token #7

Closed rickshaw5724 closed 1 year ago

rickshaw5724 commented 1 year ago

From your readme: Unfortunately, GitHub Actions does not support publishing Maven artifacts without authentication, so you will need a GitHub access token to build with these commands. You will have to build TrajoptLib from source.

Sorry, I am new to gradle and Maven. Can you describe where you enter your personal access token after you create one with your github account? I suspect there must be a git command to set the user name and access token. I tried git remote set-url origin https://@github.com//.git, and used my token and user name, and 'TripleHelixProgramming/HelixNavigator' for the repo_name. But the error is regarding access to the pom file for Trajoptlib.

Actual error text: Could not resolve all files for configuration ':app:compileClasspath'.

Could not resolve org.team2363:helixtrajectory:0.0.0-pre5. Required by: project :app Could not resolve org.team2363:helixtrajectory:0.0.0-pre5. Could not get resource 'https://maven.pkg.github.com/SleipnirGroup/TrajoptLib/org/team2363/helixtrajectory/0.0.0-pre5/helixtrajectory-0.0.0-pre5.pom'. Could not GET 'https://maven.pkg.github.com/SleipnirGroup/TrajoptLib/org/team2363/helixtrajectory/0.0.0-pre5/helixtrajectory-0.0.0-pre5.pom'. Received status code 401 from server: Unauthorized

Any help would be appreciated.

jlbabilino commented 1 year ago

Yeah this is a super annoying issue. Thanks for your interest in trying out the app btw.

Go to app/build.gradle.kts:26, change the key to "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". Try running ./gradlew run again.

Normally I'd just put the access token right into the commit but GitHub won't let me do that for security reasons. I'm not even sure if this key will work once I post this comment. 🤷‍♂️

jlbabilino commented 1 year ago

Yeah I think it just deleted it. Let's try something else...

Here's a token, but the string is reversed: eXZVG2mwhVgTh25QHwQiHaBkaecs7gA1qC9Q_phg. Reverse that on your end with this tool then try the same thing again.

rickshaw5724 commented 1 year ago

Thanks much for the help. Rather than using the token you gave me, now that I know the user name and token are on line 26 of the build.gradle.kts, I entered my github user name and my classic access token and that did the trick. Thanks again!

jlbabilino commented 1 year ago

Wow that's interesting. If you want, you can edit the README to show how you did it, and I'll accept it.

rickshaw5724 commented 1 year ago

I couldn't figure out how to allow my account to do a push request to your remote HelixNavigator repository.

The change I would make to README would be to add one note after your note regarding the need to use personal access tokens that says: (see example below).

Then at the end of the README I would add:

Example note to allow ./gradlew commands to access [TrajoptLib](

https://github.com/SleipnirGroup/TrajoptLib) from Maven.

On Wed, Feb 8, 2023 at 7:14 PM Justin Babilino @.***> wrote:

Wow that's interesting. If you want, you can edit the README to show how you did it, and I'll accept it.

— Reply to this email directly, view it on GitHub https://github.com/TripleHelixProgramming/HelixNavigator/issues/7#issuecomment-1423407208, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATJKVZIDUDTI5VHZXDX7QNTWWQZH7ANCNFSM6AAAAAAUUTVDGA . You are receiving this because you modified the open/close state.Message ID: @.***>