aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/devenv_commands.py
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-02-08 12:40:15 +0100
committerGitHub <noreply@github.com>2024-02-08 11:40:15 +0000
commit5facf436f6835aa53a500ae99168b8a00ed4802c (patch)
tree9af0603e5e76781ef397c2063a1b46389b6e5be4 /python/servo/devenv_commands.py
parent3620cfe2dd9e31e04663420fc5bd29421b33ede3 (diff)
downloadservo-5facf436f6835aa53a500ae99168b8a00ed4802c.tar.gz
servo-5facf436f6835aa53a500ae99168b8a00ed4802c.zip
mach: Make `./mach try` a little friendlier (#31290)
1. Move `./mach try` to `testing_commands.py which is a bit more consistent. 2. Make `./mach try` print out the remote name always and properly form the URL for ssh repositories. 3. Print out the try configuration matrix to make it more obvious what is being triggered remotely. 4. Better error handling. Print and error and exit if the remote isn't on GitHub and also clean up properly if something fails after making the temporary commit.
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r--python/servo/devenv_commands.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index ed260cf8b3b..7e4cf49e56e 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -22,7 +22,6 @@ from mach.decorators import (
)
from servo.command_base import CommandBase, cd, call
-from servo.try_parser import Config
@CommandProvider
@@ -272,37 +271,3 @@ class MachCommands(CommandBase):
"--verbose",
], env=env)
return p.wait()
-
- @Command('try',
- description='Runs try jobs by force pushing to try branch',
- category='devenv')
- @CommandArgument(
- '--remote', '-r', default="origin",
- help='git remote to use for try pushes')
- @CommandArgument(
- 'try_string', default=None, nargs='...',
- help="Try string")
- def try_jobs(self, remote="origin", try_string=None):
- if not try_string:
- try_string = "full"
- else:
- try_string = " ".join(try_string)
- conf = Config(try_string)
- result = call(["git", "commit", "--allow-empty", "-m", try_string, "-m", f"{conf.to_json()}"])
- if result != 0:
- return result
-
- git_remote = subprocess.check_output(["git", "config", "--get", f"remote.{remote}.url"]).decode()
- if "servo/servo" in git_remote:
- print("WARNING: You are triggering try build in upstream repo!")
-
- result = call(["git", "push", remote, "--force", "HEAD:try"])
- if result != 0:
- return result
-
- git_remote = git_remote.replace(".git", "/actions")
- print(f"You can find triggered workflow here: {git_remote}")
-
- # Remove the last commit which only contains the try configuration.
- result += call(["git", "reset", "--soft", "HEAD~1"])
- return result