feat: add --session/--keep-session/--url-only options#12
Closed
Conversation
- --session <name>: reuse a named playwright-cli session (e.g. a persistent GHE session with SAML already authenticated). Previously the default unnamed session was always used, which meant session-only cookies and "remember this device" state was not shared across invocations. - --keep-session: skip `playwright-cli session-stop` on exit. Keeping the browser process alive preserves session-only cookies, which drastically reduces the frequency of SSO/SAML re-authentication prompts. - --url-only: print uploaded asset URLs to stdout and skip comment creation/update. Lets callers post evidence via their own tooling (e.g. `gh pr review --comment --body-file`) while still using gh-attach for the upload step. Primary motivation: on GHE behind OneLogin SAML, the previous flow forced a fresh login many times per day because the browser session was torn down after every upload. With `--session ghe --keep-session`, a single morning login keeps working for the whole day. Bumps VERSION to 0.7.0.
Owner
Author
|
GHE は React 実装のため file-attachment カスタム要素が存在せず Direct mode が使えない。Browser mode の URL extraction も GHE の textarea 構造と非互換。結局 dotfiles 側の wrapper を playwright-cli 直接実行方式に戻したので、このPRの変更は GHE 用途には不要。github.com 用途では有用 (future use) なので、別PRで本家に出す形にする。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three new options to
gh-attachso that it can be used as a drop-inreplacement for bespoke playwright-cli wrappers against GHE (git.pepabo.com)
behind OneLogin SAML:
--session <name>— reuse a namedplaywright-clisession (e.g. apersistent
ghesession that has already been SAML-authenticated). Theprevious behavior was to always use the unnamed default session, which
meant session-only cookies and "remember this device" state were not
shared across invocations.
--keep-session— skipplaywright-cli session-stopon exit. Keepingthe browser process alive preserves session-only cookies, dramatically
reducing the frequency of SAML re-authentication prompts.
--url-only— print uploaded asset URLs to stdout (one per line) andskip comment creation/update. Lets callers post evidence via their own
tooling (e.g.
gh pr review --comment --body-file) while still usinggh-attachfor the upload step.Motivation
On GHE behind OneLogin SAML, the existing flow forced a fresh SAML login
many times per day because the browser session was torn down after every
upload. With
--session ghe --keep-session, a single morning login keepsworking for the whole day.
Bumps VERSION to 0.7.0.
Test plan
gh-attach --helplists the three new optionsbash -n bin/gh-attachpasses syntax checkgh-attach --session ghe --keep-session --url-only --issue N --image foo.png --host git.pepabo.com --repo OWNER/REPOuploads without tearing down the session and prints only the URL