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

Training scripts on GHEC #406

Open
edinc opened this issue Nov 1, 2023 · 6 comments
Open

Training scripts on GHEC #406

edinc opened this issue Nov 1, 2023 · 6 comments

Comments

@edinc
Copy link

edinc commented Nov 1, 2023

Hello,

Has anyone tried running the scripts to generate the repositories on an GHEC instance? I have an SSO account and a organisation (with Owner privileges), but somehow it still doesn't work.
I have created a PAT Token and authorised it for SAML single sign-on. Tried providing both api.github.com and github.com/enterprises/<customer-name> in the .trainingmanualrc file. When running the 'Confirm Setup' step, this is what I get:

Checking if  is accessible via the API...
Can't access the organization via the API.

Is it even possible to run the scripts on GHEC or I need to follow the steps from the README regarding GitHub Enterprise Server?

@amyschoen
Copy link
Collaborator

I have a local branch where I've been working on it, but I haven't uploaded any of it here yet. What kind of access are you setting up in your token? I've found that for ours, we need someone who has org admin level access because we need to be able to invite users into our training org in GHEC. I haven't had any difficulties accessing the API for our set up for GHEC.

@amyschoen
Copy link
Collaborator

Realized I should look at my .trainingmanualrc. I have this set for URLs:

export INSTANCE_URL='api.github.com'
export ROOT_URL='github.com'

I'd have to look at what changes I made specifically for GHEC since it's been a few months. I haven't contributed back yet because what I have is a bit hacky, and I want to clean things up first. I know when we worked on supporting both GHES and .com, there are conditionals that treat the two differently in some ways. As written, the scripts would treat GHEC as .com based on the base URLs which isn't always what we want. There are some subtleties, and GHEC does behave more like GHES.

@edinc
Copy link
Author

edinc commented Nov 15, 2023

Thank you for the input @amyschoen. I found a way with a small workaround.

  • Gave the PAT token full permission and authorised it for SAML single sign-on
  • My .trainingmanualrc file
export TOKEN_OWNER='SSO account'
export TEACHER_PAT='TOKEN'
export INSTANCE_URL='api.github.com'
export ROOT_URL='github.com'
export CLASS_ORG='Organization name'
  • The script still didn't want to create the caption-this repository, but I used the template to generate the repository manually within the Organization
  • After that I manually added all the participants. First to the Organization, than to the caption-this repository
  • Once the participants were added as Collaborators, I was able to generate the conflict-practice and github-games repositories with all the corresponding Issues and Pull Requests for all the participants, using the script

Maybe this will help someone else who has issues setting up the training on GHEC.

@edinc edinc closed this as completed Nov 15, 2023
@amyschoen
Copy link
Collaborator

amyschoen commented Nov 15, 2023

What is your repo visibility @edinc? We don't allow public which is what was breaking repo generation via the scripts for me. My fix was to create repos as internal for GHEC.

Editing to add that I also needed to add logic to invite users to the org. Just need to get some time to do clean up before I can contribute my updates back.

@edinc edinc reopened this Nov 16, 2023
@edinc
Copy link
Author

edinc commented Nov 16, 2023

The repo visibility was Internal. I reopened the Issue, you can link it together with you contributions when you open a PR 😃

@amyschoen
Copy link
Collaborator

I'll try to get my changes pushed here in early December even if it's just a branch so you can test if my changes work for your GHEC instance as well. Taking a lot of year-end PTO, so no promises on timeframe.

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

No branches or pull requests

2 participants