Skip to content
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

commit-range action intermittent failure #601

Open
akaihola opened this issue Jul 29, 2024 · 0 comments
Open

commit-range action intermittent failure #601

akaihola opened this issue Jul 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@akaihola
Copy link
Owner

akaihola commented Jul 29, 2024

Every now and then the commit-range action crashes with Git's fatal: bad object <hash>. The github.event.commits structure contains two commits, but the local clone actually only has one.

This happened e.g. in build #41 for #591:

github.event.commits in env.commit_list
env:
  commit_list: [
  {
    "author": {
      "email": "13725+akaihola@users.noreply.github.com",
      "name": "Antti Kaihola",
      "username": "akaihola"
    },
    "committer": {
      "email": "13725+akaihola@users.noreply.github.com",
      "name": "Antti Kaihola",
      "username": "akaihola"
    },
    "distinct": true,
    "id": "06dfd005c3050f9a13a3b20f32cd3c0d70765da5",
    "message": "GitHub action enhancements\n\n- change to working directory\n- install `pip-requirements-parser` in a separate step\n- include Darker exit code in outputs\n- include Darker standard output in outputs\n- run `commit-range` action locally",
    "timestamp": "2024-07-30T01:08:04+03:00",
    "tree_id": "2419b5a681fc2200ec4f0423635b4b4dee008a7a",
    "url": "https://github.com/akaihola/darker/commit/06dfd005c3050f9a13a3b20f32cd3c0d70765da5"
  },
  {
    "author": {
      "email": "13725+akaihola@users.noreply.github.com",
      "name": "Antti Kaihola",
      "username": "akaihola"
    },
    "committer": {
      "email": "13725+akaihola@users.noreply.github.com",
      "name": "Antti Kaihola",
      "username": "akaihola"
    },
    "distinct": true,
    "id": "0d5b83a3c875db922d82bfa5022b4fa62f0bda09",
    "message": "Workflow to test `working-directory` action input",
    "timestamp": "2024-07-30T01:08:04+03:00",
    "tree_id": "f2da2a4337a344e41291b3e5805f90f7e92d3aba",
    "url": "https://github.com/akaihola/darker/commit/0d5b83a3c875db922d82bfa5022b4fa62f0bda09"
  },
  {
    "author": {
      "email": "13725+akaihola@users.noreply.github.com",
      "name": "Antti Kaihola",
      "username": "akaihola"
    },
    "committer": {
      "email": "13725+akaihola@users.noreply.github.com",
      "name": "Antti Kaihola",
      "username": "akaihola"
    },
    "distinct": true,
    "id": "7003e2a03e139366ba75993acf75912bef2d7697",
    "message": "Adjust `--stdin-filename` tests to new exit codes",
    "timestamp": "2024-07-30T01:08:04+03:00",
    "tree_id": "66c7f454336031b305eea1c57a444bc0ccdfd213",
    "url": "https://github.com/akaihola/darker/commit/7003e2a03e139366ba75993acf75912bef2d7697"
  }
]

Log for step Fail if no exit code 2 even though test.py was not found in the test-working-directory job:

fatal: bad object 06dfd005c3050f9a13a3b20f32cd3c0d70765da5
##[error]Process completed with exit code 128.
##[group]Run echo "::error::Darker should have failed with exit code 2"
echo "::error::Darker should have failed with exit code 2"
echo "::error::It exited with "
exit 1
shell: /usr/bin/bash -e {0}
##[endgroup]
##[error]Darker should have failed with exit code 2
##[error]It exited with 
##[error]Process completed with exit code 1.

For this particular run I didn't have debug logging active for commit-range, but very probably git log would have only displayed the last commit at the time (7003e2a0). The commit hash in bad object 06dfd005 referred to the third-last commit at the time.

@akaihola akaihola added bug Something isn't working help wanted Extra attention is needed labels Jul 29, 2024
@akaihola akaihola self-assigned this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Development

No branches or pull requests

1 participant