Skip to content

testing functionality for rebasing from viable/strict #1

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

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b7a89fe
Added note about Dev Infra Office Hours in CONTRIBUTING.md (#76667)
swang392 May 19, 2022
6c39d76
Added note about Dev Infra Office Hours in CONTRIBUTING.md (#76667)
swang392 May 19, 2022
34aa244
added Wiki link instead, removed a.out and third_party changes
swang392 May 19, 2022
c775062
changed install_katex.sh to install_docs_reqs.sh, added install doxygen
swang392 May 19, 2022
1bff7a8
Resolved ToC regeneration error
swang392 May 20, 2022
27a06bb
Added link to the Developing Pytorch section
swang392 May 20, 2022
92a7593
Added note about Dev Infra Office Hours in CONTRIBUTING.md (#76667)
swang392 May 19, 2022
9119d7b
added Wiki link instead, removed a.out and third_party changes
swang392 May 19, 2022
c9192bc
changed install_katex.sh to install_docs_reqs.sh, added install doxygen
swang392 May 19, 2022
f76129f
Merge branch 'updated-contributing' into install-doxygen
swang392 May 20, 2022
c810275
Only added install doxygen with original install_katex lines
swang392 May 20, 2022
485de2f
Merge branch 'install-doxygen' of https://github.com/swang392/pytorch…
swang392 May 20, 2022
48abfbf
added Wiki link instead, removed a.out and third_party changes
swang392 May 19, 2022
36f4115
Resolved ToC regeneration error
swang392 May 20, 2022
0239709
Added link to the Developing Pytorch section
swang392 May 20, 2022
b99aae9
removed install doxygen calls from Dockerfiles, added in install_kate…
swang392 May 20, 2022
dfdd991
added Wiki link instead, removed a.out and third_party changes
swang392 May 19, 2022
c101f62
changed install_katex.sh to install_docs_reqs.sh, added install doxygen
swang392 May 19, 2022
26569a8
Resolved ToC regeneration error
swang392 May 20, 2022
ec183a4
Added link to the Developing Pytorch section
swang392 May 20, 2022
2a1fb6b
Only added install doxygen with original install_katex lines
swang392 May 20, 2022
d79f946
changed install_katex.sh to install_docs_reqs.sh, added install doxygen
swang392 May 19, 2022
e8b99d7
Merge branch 'install-doxygen' of github.com:pytorch/pytorch into ins…
swang392 May 20, 2022
583d5f1
Merge branch 'master' into install-doxygen
swang392 May 20, 2022
beae606
renamed install_katex.sh to install_docs_reqs.sh across the codebase
swang392 May 20, 2022
a785b74
Merge branch 'install-doxygen' of github.com:swang392/pytorch into in…
swang392 May 20, 2022
0fe7a73
Added note about Dev Infra Office Hours in CONTRIBUTING.md (#76667)
swang392 May 19, 2022
45fa539
added contributing.md to merge branches
swang392 May 23, 2022
75c8d2f
added contributing.md to merge install-doxygen branch
swang392 May 23, 2022
3ade8dd
adding functionality for rebasing to viable/strict branch
swang392 May 24, 2022
eb57627
github branch merging issues with CONTRIBUTING.md
swang392 May 24, 2022
bed3cc1
Merge branch 'viable/strict' of github.com:pytorch/pytorch into add-s…
swang392 May 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ if [ -n "$KATEX" ]; then
apt-get install -y --no-install-recommends yarn
yarn global add katex --prefix /usr/local

sudo apt-get -y install doxygen

apt-get autoclean && apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand Down
4 changes: 2 additions & 2 deletions .circleci/docker/ubuntu-cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ RUN bash ./install_user.sh && rm install_user.sh

# Install katex
ARG KATEX
ADD ./common/install_katex.sh install_katex.sh
RUN bash ./install_katex.sh && rm install_katex.sh
ADD ./common/install_docs_reqs.sh install_docs_reqs.sh
RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh

# Install conda and other packages (e.g., numpy, pytest)
ENV PATH /opt/conda/bin:$PATH
Expand Down
4 changes: 2 additions & 2 deletions .circleci/docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ RUN bash ./install_user.sh && rm install_user.sh

# Install katex
ARG KATEX
ADD ./common/install_katex.sh install_katex.sh
RUN bash ./install_katex.sh && rm install_katex.sh
ADD ./common/install_docs_reqs.sh install_docs_reqs.sh
RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh

# Install conda and other packages (e.g., numpy, pytest)
ENV PATH /opt/conda/bin:$PATH
Expand Down
2 changes: 0 additions & 2 deletions .circleci/scripts/cpp_doc_push_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ git clone https://github.com/pytorch/cppdocs

set -ex

sudo apt-get -y install doxygen

# Generate ATen files
pushd "${pt_checkout}"
pip install -r requirements.txt
Expand Down
19 changes: 13 additions & 6 deletions .github/scripts/tryrebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ def parse_args() -> Any:
from argparse import ArgumentParser
parser = ArgumentParser("Rebase PR into branch")
parser.add_argument("--dry-run", action="store_true")
parser.add_argument("--stable", action ="store_true")
parser.add_argument("pr_num", type=int)
return parser.parse_args()


def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None:
def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False, stable: bool = False) -> None:
branch = f"pull/{pr.pr_num}/head"
onto_branch = pr.default_branch()
if stable:
onto_branch = "viable/strict"
else:
onto_branch = pr.default_branch()
remote_url = f"https://github.com/{pr.info['headRepository']['nameWithOwner']}.git"
refspec = f"{branch}:{pr.head_ref()}"

Expand All @@ -39,11 +43,14 @@ def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None:
"git pull --rebase`)", dry_run=dry_run)


def rebase_ghstack_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None:
def rebase_ghstack_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False, stable: bool = False) -> None:
if subprocess.run([sys.executable, "-m", "ghstack", "--help"], capture_output=True).returncode != 0:
subprocess.run([sys.executable, "-m", "pip", "install", "ghstack"])
orig_ref = f"{re.sub(r'/head$', '/orig', pr.head_ref())}"
onto_branch = pr.default_branch()
if stable:
onto_branch = "viable/strict"
else:
onto_branch = pr.default_branch()

repo.fetch(orig_ref, orig_ref)
repo._run_git("rebase", onto_branch, orig_ref)
Expand Down Expand Up @@ -102,9 +109,9 @@ def main() -> None:

try:
if pr.is_ghstack_pr():
rebase_ghstack_onto(pr, repo, dry_run=args.dry_run)
rebase_ghstack_onto(pr, repo, dry_run=args.dry_run, stable=args.stable)
return
rebase_onto(pr, repo, dry_run=args.dry_run)
rebase_onto(pr, repo, dry_run=args.dry_run, stable=args.stable)
except Exception as e:
msg = f"Rebase failed due to {e}"
run_url = os.getenv("GH_RUN_URL")
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/tryrebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.MERGEBOT_TOKEN }}
PR_NUM: ${{ github.event.client_payload.pr_num }}
GH_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
STABLE: ${{ github.event.client_payload.stable}}
run: |
python3 .github/scripts/tryrebase.py "${PR_NUM}"
set -ex
if [ -n "${STABLE}" ]; then
python3 .github/scripts/tryrebase.py --stable "${PR_NUM}"
else
python3 .github/scripts/tryrebase.py "${PR_NUM}"
fi
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1314,4 +1314,4 @@ your PRs, but it will still be present for the select CircleCI jobs listed
above.

## Dev Infra Office Hours
[Dev Infra Office Hours](https://github.com/pytorch/pytorch/wiki/Dev-Infra-Office-Hours) are hosted every Friday to answer any questions regarding developer experience, Green HUD, and CI.
[Dev Infra Office Hours](https://github.com/pytorch/pytorch/wiki/Dev-Infra-Office-Hours) are hosted every Friday to answer any further questions regarding developer experience, green HUD, and CI.