diff --git a/README.md b/README.md index b1cc5d00ce7c939cd0af53d8dfbd4ab5bee0157c..7f25a39091aec81adedb274af8fa48a4574a068b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ After installing mrhlpr (see below) and [configuring a gpg key](https://git-scm. 4. Optionally squash all commits (`git rebase -i master`). 5. Check if everything is fine (`mrhlpr status`). 6. Choose one of: - 1. Finish things automatically following the instructions (`mrhlpr finish`). You will need to have the environment variable `GITLAB_TOKEN` set in your environment containing a [Personal Access Token](https://gitlab.com/-/user_settings/personal_access_tokens) with the "api" scope. + 1. Finish things automatically following the instructions (`mrhlpr finish`). You will need to have the environment variable `GITLAB_TOKEN` set in your environment containing a [Personal Access Token](https://gitlab.postmarketos.org/-/user_settings/personal_access_tokens) with the "api" scope. 2. Manually push and merge: 1. If everything looks good force push (`git push --force`). 2. In the GitLab web UI: wait for CI, then merge. @@ -32,10 +32,10 @@ Start with `mrhlpr checkout` and the MR-ID. The built-in checklist will tell the ```shell-session $ cd ~/code/pmbootstrap/aports $ mrhlpr checkout 81 -Download https://gitlab.com/api/v4/projects/postmarketOS%2Fpmaports/merge_requests/81 -Download https://gitlab.com/api/v4/projects/8065375 +Download https://gitlab.postmarketos.org/api/v4/projects/postmarketOS%2Fpmaports/merge_requests/81 +Download https://gitlab.postmarketos.org/api/v4/projects/8065375 Checkout feature/abuild-sign-noinclude from postmarketOS/feature/abuild-sign-noinclude -https://gitlab.com/postmarketOS/pmaports/merge_requests/81 +https://gitlab.postmarketos.org/postmarketOS/pmaports/merge_requests/81 "main/abuild-sign-noinclude: new aport" (!81) 10 commits from postmarketOS/feature/abuild-sign-noinclude @@ -55,7 +55,7 @@ Checklist: ```shell-session $ git rebase -i master $ mrhlpr status -https://gitlab.com/postmarketOS/pmaports/merge_requests/81 +https://gitlab.postmarketos.org/postmarketOS/pmaports/merge_requests/81 "main/abuild-sign-noinclude: new aport" (!81) 1 commit from postmarketOS/feature/abuild-sign-noinclude @@ -75,7 +75,7 @@ Checklist: ```shell-session $ mrhlpr fixmsg Appending ' (!81)' to all commits... -https://gitlab.com/postmarketOS/pmaports/merge_requests/81 +https://gitlab.postmarketos.org/postmarketOS/pmaports/merge_requests/81 "main/abuild-sign-noinclude: new aport" (!81) 1 commit from postmarketOS/feature/abuild-sign-noinclude @@ -122,7 +122,7 @@ Optionally you can add a `.mrhlpr.json` file to your respository, this contains ### Portability -This script is not postmarketOS specific, it should work with any GitLab repository. Right now, only gitlab.com is detected - but detecting any GitLab servers could be added in `mrhlpr/gitlab.py:parse_git_origin()` if desired. +This script is not postmarketOS specific, it should work with any GitLab repository. Right now, only gitlab.postmarketos.org is detected - but detecting any GitLab servers could be added in `mrhlpr/gitlab.py:parse_git_origin()` if desired. ### Troubleshooting diff --git a/mrhlpr/git.py b/mrhlpr/git.py index c77a6f51ced732d39c7336bc0ee457432c3ee186..491239e7ea0f797fb2058feeae73854062388ded 100644 --- a/mrhlpr/git.py +++ b/mrhlpr/git.py @@ -34,7 +34,7 @@ def run( def get_remote_url(remote: str = "origin") -> Optional[str]: """:returns: the remote URL as string, e.g. - "https://gitlab.com/postmarketOS/pmaports.git" """ + "https://gitlab.postmarketos.org/postmarketOS/pmaports.git" """ ret = run(["remote", "get-url", remote], check=False) return ret diff --git a/mrhlpr/gitlab.py b/mrhlpr/gitlab.py index 0108209fa97fdcfa99a1b80c21f47181c7631424..8c3cff108b2f62e5936c4c1290aeadf301945e13 100644 --- a/mrhlpr/gitlab.py +++ b/mrhlpr/gitlab.py @@ -120,12 +120,12 @@ def parse_git_origin() -> GitLabOrigin: mrtest/origin.py. :returns: a GitLabOrigin object like the following: - api: "https://gitlab.com/api/v4" + api: "https://gitlab.postmarketos.org/api/v4" api_project_id: "postmarketOS%2Fmrhlpr" - full: "git@gitlab.com:postmarketOS/mrhlpr.git" + full: "git@gitlab.postmarketos.org:postmarketOS/mrhlpr.git" project: "postmarketOS" project_id: "postmarketOS/mrhlpr" - host: "gitlab.com" + host: "gitlab.postmarketos.org" username: None """ # Try to get the URL @@ -137,7 +137,7 @@ def parse_git_origin() -> GitLabOrigin: # Find the host domains = [ "gitlab.alpinelinux.org", - "gitlab.com", + "gitlab.postmarketos.org", "gitlab.freedesktop.org", "gitlab.gnome.org", "invent.kde.org", diff --git a/mrhlpr/mr.py b/mrhlpr/mr.py index c8ea1ebfb7d5ff9b99769e4e4ee44c6105c76e26..5794627145526141a22ab63ff4317d58ff99c859 100644 --- a/mrhlpr/mr.py +++ b/mrhlpr/mr.py @@ -292,7 +292,7 @@ def checkout( + remote_local + "' manually and check the output, most" " likely you ran into this problem:" - " https://gitlab.com/postmarketOS/mrhlpr/issues/1" + " https://gitlab.postmarketos.org/postmarketOS/mrhlpr/issues/1" ) sys.exit(1) @@ -529,7 +529,7 @@ def finish( exit(1) push(mr_id, no_cache) - gl = gitlab_api.Gitlab(url="https://gitlab.com", private_token=gitlab_token) + gl = gitlab_api.Gitlab(url="https://gitlab.postmarketos.org", private_token=gitlab_token) try: gl.auth() except gitlab_api.exceptions.GitlabAuthenticationError as authentication_exception: @@ -561,7 +561,7 @@ def finish( mr.notes.create({"body": comment}) # Proper stupid but it works. Originally I had this set to a maximum of 15 seconds - # of sleepy time, but for gitlab.com this wasn't always sufficient to catch up. + # of sleepy time, but for gitlab.postmarketos.org this wasn't always sufficient to catch up. print("Setting to auto-merge (may take up to 25 seconds)...") for _ in range(5): try: diff --git a/mrhlpr/mrdb.py b/mrhlpr/mrdb.py index a28f1e89adf9aa6277826adfb1f8093b5ce7ca0c..621d2d0b631d0ee623a51985c2eff6dd88f557bc 100644 --- a/mrhlpr/mrdb.py +++ b/mrhlpr/mrdb.py @@ -10,7 +10,7 @@ from typing import Optional def load() -> dict[str, dict[str, dict[str, int]]]: """:returns: dict of the loaded lookup table, looks like: - {"gitlab.com": + {"gitlab.postmarketos.org": {"postmarketOS/pmaports": {"sailfish": 66, "grate-driver": 67}}}""" diff --git a/mrhlpr/runner.py b/mrhlpr/runner.py index 8af142b55d72a1f54644bf6367b3c41f83d3a8bd..5c02e64f25daa30cfe5f0e3cebf17ae6b6a89f27 100644 --- a/mrhlpr/runner.py +++ b/mrhlpr/runner.py @@ -66,7 +66,7 @@ def verify(runner): it. Exit if the user does not trust it. :param runner: as returned from the gitlab jobs api: {"id": 12270837, - "description": "4-blue.shared.runners-manager.gitlab.com/default", + "description": "4-blue.shared.runners-manager.gitlab.postmarketos.org/default", "ip_address": "34.74.35.215", "active": true, "paused": false, diff --git a/mrtest/origin.py b/mrtest/origin.py index 15015846d546da87417a04c80c0b1415d33df7a5..a21bd89b3291a6ca1f5eff22c4fc5f7b48a2f6e7 100644 --- a/mrtest/origin.py +++ b/mrtest/origin.py @@ -6,12 +6,12 @@ needed for mrhlpr.gitlab.parse_git_origin().""" from mrhlpr.gitlab import GitLabOrigin pmaports = GitLabOrigin( - api="https://gitlab.com/api/v4", + api="https://gitlab.postmarketos.org/api/v4", api_project_id="postmarketOS%2Fpmaports", - full="git@gitlab.com:postmarketOS/pmaports.git", + full="git@gitlab.postmarketos.org:postmarketOS/pmaports.git", project="postmarketOS", project_id="postmarketOS/pmaports", - host="gitlab.com", + host="gitlab.postmarketos.org", username=None, )