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

🛠 Tooling: Use the create engine for network requests #1752

Closed
3 tasks done
JoshuaKGoldberg opened this issue Dec 7, 2024 · 3 comments · Fixed by #1776
Closed
3 tasks done

🛠 Tooling: Use the create engine for network requests #1752

JoshuaKGoldberg opened this issue Dec 7, 2024 · 3 comments · Fixed by #1776
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! status: blocked Waiting for something else to be resolved

Comments

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Dec 7, 2024

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Splitting out of #1181: I'm onboarding this project to the new "create" engine in https://github.com/JoshuaKGoldberg/create. #1670 added usage of file creations. Another step will be having network requests such as GitHub branch protections and repo settings provided by blocks.

Additional Info

Linked issue in create: JoshuaKGoldberg/bingo#23

💖

@JoshuaKGoldberg JoshuaKGoldberg added area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this! labels Dec 7, 2024
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Dec 7, 2024
@JoshuaKGoldberg
Copy link
Owner Author

For reference, here are the network requests sent in CTA today as part of >=1 mode runtime...

  • octokit.rest.repos.get({ owner, repo }): in doesRepositoryExist, to check whether the repository exists
    • If it does, shell scripts around git remote add origin and git push -u origin main --force are sent
  • octokit.rest.users.getAuthenticated(): in getGitHubUserAsAllContributor, to add the current user as an allcontributors contributor
  • octokit.rest.repos.createUsingTemplate, octokit.rest.repos.createForAuthenticatedUser, or octokit.rest.repos.createInOrg: in createRepositoryWithApi
  • octokit.rest.repos.update: in initializeRepositorySettings
  • octokit.request('PUT /repos ... /branches/main/protection): in initializeBranchProtectionSettings
  • octokit.request('GET .../labels'), octokit.request('POST .../labels'), octokit.request('DELETE .../labels'), and octokit.request('PATCH .../labels'): in initializeRepositoryLabels

Roughly. I might have missed some.

@JoshuaKGoldberg
Copy link
Owner Author

Will tackle first: #1768.

@JoshuaKGoldberg JoshuaKGoldberg added status: blocked Waiting for something else to be resolved and removed area: tooling Managing the repository's maintenance labels Dec 15, 2024
JoshuaKGoldberg added a commit that referenced this issue Dec 16, 2024
…-for-repository internally (#1772)

## PR Checklist

- [x] Addresses an existing open issue: fixes #1768
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

Brings on a few utilities I recently extracted:

* https://github.com/JoshuaKGoldberg/octokit-from-auth
*
https://github.com/JoshuaKGoldberg/populate-all-contributors-for-repository
* https://github.com/JoshuaKGoldberg/set-github-repository-labels

These should all have the same functionality as before. This should be a
`chore:` PR, not a `feat:` or `fix:`.

The utility here is that the latter two are now used as standalone
scripts in onboarding to the "create" engine. I thought they'd be done
as network requests (#1752), but in this way I found it a lot simpler to
have them as standalone scripts (#1751,
JoshuaKGoldberg/bingo#60).

💖
JoshuaKGoldberg added a commit that referenced this issue Dec 17, 2024
## PR Checklist

- [x] Addresses an existing open issue: fixes #1752
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

Adds in Blocks around Octokit settings. Also adds all three GitHub
setter Blocks to `presetMinimal`.

💖
Copy link

🎉 This is included in version v1.77.1 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! status: blocked Waiting for something else to be resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant