{"id":15055549,"url":"https://github.com/mgedmin/gitlab-trace","last_synced_at":"2025-04-10T03:52:28.769Z","repository":{"id":56021196,"uuid":"293763725","full_name":"mgedmin/gitlab-trace","owner":"mgedmin","description":"Show a GitLab pipeline status or job trace","archived":false,"fork":false,"pushed_at":"2025-01-20T12:24:58.000Z","size":132,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T03:52:23.935Z","etag":null,"topics":["command-line","gitlab"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/gitlab-trace","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgedmin.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-08T09:30:30.000Z","updated_at":"2025-01-20T12:25:00.000Z","dependencies_parsed_at":"2023-01-28T13:32:51.315Z","dependency_job_id":"5aacf448-5c9f-463a-b003-f4d83bf3089f","html_url":"https://github.com/mgedmin/gitlab-trace","commit_stats":{"total_commits":71,"total_committers":1,"mean_commits":71.0,"dds":0.0,"last_synced_commit":"43a547efccd73fee6cb07eea5cb75b8f822dcb2e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgedmin%2Fgitlab-trace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgedmin%2Fgitlab-trace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgedmin%2Fgitlab-trace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgedmin%2Fgitlab-trace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgedmin","download_url":"https://codeload.github.com/mgedmin/gitlab-trace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154998,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","gitlab"],"created_at":"2024-09-24T21:44:22.897Z","updated_at":"2025-04-10T03:52:28.732Z","avatar_url":"https://github.com/mgedmin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Look at GitLab CI job status from the command line\n==================================================\n\n.. image:: https://github.com/mgedmin/gitlab-trace/actions/workflows/build.yml/badge.svg?branch=master\n    :target: https://github.com/mgedmin/gitlab-trace/actions\n\n.. image:: https://coveralls.io/repos/mgedmin/gitlab-trace/badge.svg?branch=master\n    :target: https://coveralls.io/r/mgedmin/gitlab-trace\n\nSometimes I want to look at the GitLab CI build status from my terminal ::\n\n    $ gitlab-trace\n    GitLab project: Foretagsdeklaration/foretagsdeklaration\n    Available jobs for pipeline #84214:\n       --job=500786 - success - build_server\n       --job=500787 - success - build_client\n       --job=500788 - success - test_safety\n       --job=500789 - success - test_dev_safety\n       --job=500790 - success - test_bandit\n       --job=500791 - success - test_crontabs\n       --job=500792 - success - test_newrelic\n       --job=500793 - success - unittests_server\n       --job=500794 - success - unittests_client\n       --job=500795 - success - build_docker_image\n       --job=500796 - failed - test_robot\n       --job=500797 - success - test_robot_bolfin\n\nYou can take a closer look at a failed job by passing the job ID ::\n\n    $ gitlab-trace --job=500796\n    ...\n    Uploading artifacts...\n    robottests/output: found 540 matching files\n    Uploading artifacts to coordinator... ok            id=500796 responseStatus=201 Created token=6yaRqQPr\n    ERROR: Job failed: exit code 1\n\nYou can watch a job while it is running ::\n\n    $ gitlab-trace --job=500796 --tail --follow\n    ...\n    Uploading artifacts...\n    robottests/output: found 540 matching files\n    Uploading artifacts to coordinator... ok            id=500796 responseStatus=201 Created token=6yaRqQPr\n    ERROR: Job failed: exit code 1\n\nYou can watch the currently running job ::\n\n    $ gitlab-trace --running --tail --follow\n    ...\n    Uploading artifacts...\n    robottests/output: found 540 matching files\n    Uploading artifacts to coordinator... ok            id=500796 responseStatus=201 Created token=6yaRqQPr\n    ERROR: Job failed: exit code 1\n\nYou can look at a different branch ::\n\n    $ gitlab-trace --branch=master\n    GitLab project: Foretagsdeklaration/foretagsdeklaration\n    https://git.vaultit.org/Foretagsdeklaration/foretagsdeklaration/pipelines/84185\n    Available jobs for pipeline #84185:\n       --job=500692 - success - build_server\n       --job=500693 - success - build_client\n       --job=500694 - success - test_safety\n       --job=500695 - success - test_dev_safety\n       --job=500696 - success - test_bandit\n       --job=500697 - success - test_crontabs\n       --job=500698 - success - test_newrelic\n       --job=500699 - success - unittests_server\n       --job=500700 - success - unittests_client\n       --job=500701 - success - build_docker_image\n       --job=500702 - failed - test_robot\n       --job=500703 - success - test_robot_bolfin\n       --job=500704 - success - tag_docker_image\n       --job=500705 - manual - deploy_stv_managedkube_alpha\n       --job=500706 - manual - deploy_id06_alpha\n       --job=500707 - manual - deploy_id06_alpha_fs31\n       --job=500708 - manual - deploy_id06_beta\n       --job=500709 - manual - deploy_id06_beta_fs31\n       --job=500710 - manual - deploy_stv_alpha\n       --job=500747 - success - test_robot\n\nYou can look at the Nth latest pipeline ::\n\n    $ gitlab-trace -1   # the latest one, default when run with no arguments\n\n    $ gitlab-trace -2   # the one before that\n\n    $ gitlab-trace --branch=mybranch -1   # the last one on this branch\n\nYou can look at a specific pipeline by ID ::\n\n    $ gitlab-trace 84185\n\nYou can look at a specific job in that pipeline ::\n\n    $ gitlab-trace 84185 test_robot\n\nIf a job has been retried several times you can look at a specific run ::\n\n    $ gitlab-trace 84185 test_robot 1\n\n    $ gitlab-trace 84185 test_robot 2\n\n\nInstallation\n------------\n\n``pip3 install --user gitlab-trace`` should take care of everything, just make\nsure ~/.local/bin is on your $PATH.\n\nOr you may want to use a script installer like pipx_ (my favourite).\n\n\nConfiguration\n-------------\n\nCreate a ``~/.python-gitlab.cfg`` like this::\n\n   [global]\n   default = mygitlab\n\n   [mygitlab]\n   url = https://gitlab.example.com/\n   private_token = ...\n\nYou can create a private access token in your GitLab profile settings.  It'll\nneed the \"read_api\" access scope.\n\n\nUsage\n-----\n\n.. [[[cog\n..   import cog, subprocess, textwrap, os\n..   os.environ['COLUMNS'] = '80'  # consistent line wrapping\n..   helptext = subprocess.run(['gitlab-trace', '--help'],\n..                             capture_output=True, text=True).stdout\n..   cog.outl('\\nHelp is available via ::\\n')\n..   cog.outl('    $ gitlab-trace --help')\n..   cog.outl(textwrap.indent(helptext, '    '))\n.. ]]]\n\nHelp is available via ::\n\n    $ gitlab-trace --help\n    usage: gitlab-trace [-h] [--version] [-v] [--debug] [-g NAME] [-p ID]\n                        [--job ID] [--running] [-b NAME] [-t [N]] [-f]\n                        [--print-url] [-a]\n                        [PIPELINE-ID] [JOB-NAME] [NTH-JOB-OF-THAT-NAME]\n\n    gitlab-trace: show the status/trace of a GitLab CI pipeline/job.\n\n    positional arguments:\n      PIPELINE-ID           select a GitLab CI pipeline by ID (default: the last\n                            pipeline of a git branch)\n      JOB-NAME              select a GitLab CI pipeline job by name\n      NTH-JOB-OF-THAT-NAME  select n-th GitLab CI pipeline job by this name\n                            (default: the last one)\n\n    options:\n      -h, --help            show this help message and exit\n      --version             show program's version number and exit\n      -v, --verbose         print more information\n      --debug               print even more information, for debugging\n      -g NAME, --gitlab NAME\n                            select configuration section in ~/.python-gitlab.cfg\n      -p ID, --project ID   select GitLab project ('group/project' or the numeric\n                            ID)\n      --job ID              show the trace of GitLab CI job with this ID\n      --running             show the trace of the currently running GitLab CI job,\n                            if there is one (if there's more than one, picks the\n                            first one)\n      -b NAME, --branch NAME, --ref NAME\n                            show the last pipeline of this git branch (default:\n                            the currently checked out branch)\n      -t [N], --tail [N]    show the last N lines of the trace log\n      -f, --follow          periodically poll and output additional logs as the\n                            job runs\n      --print-url, --print-uri\n                            print URL to job page on GitLab instead of printing\n                            job's log\n      -a, --artifacts       download build artifacts\n\n.. [[[end]]]\n\n.. _python-gitlab: https://pypi.org/p/python-gitlab\n.. _pipx: https://pipxproject.github.io/pipx/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgedmin%2Fgitlab-trace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgedmin%2Fgitlab-trace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgedmin%2Fgitlab-trace/lists"}