simp / simp/puppetsync

Support HTTPS + token pushes (CI-friendly; prerequisite for scheduled runs)

Open
#75 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Ruby
Stars
1
Forks
5
Avg merge
8d 1h
Merged PRs (30d)
4

Description

Problem

puppetsync pushes over SSH: git_push_to_remote runs git push <remote> against the fork's ssh_url (set up by ensure_git_remote from user_repo_fork.ssh_url), which requires a working ssh-agent. That's fine interactively, but it's the last blocker for running puppetsync unattended (#56): CI runners and scheduled jobs have a GITHUB_API_TOKEN, not an SSH identity.

This has been a stretch-goal TODO in plans/init.pp for years:

# - [ ] push changes using HTTPS basic auth + GitHub token (CI friendly)

Proposed design

  • ensure_git_remote gains a transport choice: when git.push_transport: https (session config; default remains ssh), use the fork's clone_url (https://github.com/<user>/<repo>.git) as the remote URL.

  • The push itself authenticates with the existing GITHUB_API_TOKEN without writing the token to disk or the remote URL — e.g.:

    git -c credential.helper='!f() { echo username=x-access-token; echo password=$GITHUB_API_TOKEN; }; f' push ...
    

    (env-var indirection keeps the token out of process listings and .git/config).

  • Nothing else changes: fork creation, PR creation, and the approve/merge plans already use the API token.

Notes

  • The token needs repo scope (it already does, for fork/PR creation) — in GHA, a fine-grained PAT or GitHub App token for the bot account, since the default GITHUB_TOKEN can't push to a fork owned by another account.
  • Verification can follow the established pattern: unit-spec the remote-URL/credential-helper construction, and e2e against a local file:// "fork" remote to prove the push path without touching GitHub.
  • With this, #49 (idempotency), #53 (fast re-clones), and #55 (dynamic inventory) merged, #56 (scheduled org-wide runs) has no remaining technical prerequisites.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the stretch-goal TODO in plans/init.pp and tracing ensure_git_remote and git_push_to_remote. Unit-spec the remote URL and credential-helper construction, then run the e2e path against a local file:// fork remote. Done means HTTPS token pushes work without storing the token while SSH remains the default.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github, ruby
Domain
ci-cd, devops, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.