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

Revparsing stopped working #14

Open
jzaefferer opened this issue Apr 13, 2023 · 5 comments
Open

Revparsing stopped working #14

jzaefferer opened this issue Apr 13, 2023 · 5 comments

Comments

@jzaefferer
Copy link

jzaefferer commented Apr 13, 2023

Hi! Thanks for the nice little project. It worked well for us for some months, using version/branch 0.2.2, but then stopped working a few weeks ago. We haven't yet been able to figure out what might've broke it. The last good build had output look this:

Scanning Bitrise API for previous failed/aborted builds
Scanning git repo for JIRA issues (3 anchor[s])
Revparse range: 03cbfc72b49de5ccc4c4d90815b9d19b35ca5f33^..03cbfc72b49de5ccc4c4d90815b9d19b35ca5f33
Revparse range: 03cbfc72b49de5ccc4c4d90815b9d19b35ca5f33^..03cbfc72b49de5ccc4c4d90815b9d19b35ca5f33
Revparse range: 2f8d8f4b7632d75a12214172e515d2d9f4c7fe35^..2f8d8f4b7632d75a12214172e515d2d9f4c7fe35
Updating build status for issues: [ABC-2516 ABC-2422]
2023/03/16 14:37:01 Current custom field content: "<nil>" 
2023/03/16 14:37:01 New build list: [9561 (6402)] , len: 1
2023/03/16 14:37:01 New custom field content: "9561 (6402)" 
2023/03/16 14:37:02 Current custom field content: "<nil>" 
2023/03/16 14:37:02 New build list: [9561 (6402)] , len: 1
2023/03/16 14:37:02 New custom field content: "9561 (6402)" 

Since it stopped working, the output is like this:

Scanning Bitrise API for previous failed/aborted builds
Scanning git repo for JIRA issues (3 anchor[s])
Revparse range: eb89b8231a9b88f7ba982e117a0b71f4b708dd75^..eb89b8231a9b88f7ba982e117a0b71f4b708dd75
Revparse error: %!(EXTRA *git.GitError=object not found - no match for id (30f9f037de16f4b51606083685bfc0ebf0570229))
Cannot find commit with hash: ba8581435d2a03cad37b27d1b60363e776842206
Cannot find commit with hash: 03cbfc72b49de5ccc4c4d90815b9d19b35ca5f33
Updating build status for issues: []

Both those commit hashes, ba8581435d2a03cad37b27d1b60363e776842206 and 03cbfc72b49de5ccc4c4d90815b9d19b35ca5f33 exist in the repo, both look like merge commits created by GitLab.

30f9f037de16f4b51606083685bfc0ebf0570229 also exists, its a commit created by Bitrise.

Other builds output a little less, but also the revparse error:

Scanning Bitrise API for previous failed/aborted builds
Scanning git repo for JIRA issues (1 anchor[s])
Revparse range: 5b3275de4162b454b38be9b17545c4f4e36a0d95^..5b3275de4162b454b38be9b17545c4f4e36a0d95
Revparse error: %!(EXTRA *git.GitError=object not found - no match for id (6592424107cef7443785562a308e7f73a65d2c8b))
Updating build status for issues: []

Again 6592424107cef7443785562a308e7f73a65d2c8b is a commit that exists in the repo.

I don't see anything special or problematic with those commits. Would you have any idea what could be causing the error?

@jzaefferer
Copy link
Author

I'm trying to understand what happens in https://github.com/Holdapp/bitrise-step-jira-build/blob/master/service/git.go, but I think neither my git nor go fu is good enough.

@dorianroy
Copy link

I have the same problem right now. Did you find a solution?

@jzaefferer
Copy link
Author

Nope, I haven't. We'll try out https://github.com/maqoo/bitrise-step-jira-issue-field-update as an alternative next week. The shell script isn't great, but at least I can easily run it locally.

@jzaefferer
Copy link
Author

The alternative didn't work either. We've given up on this, since our QA process no longer needs this step. Since others seem to have the same issue, I'll leave this open. Maybe just as a warning to not use this step 🤷

@dorianroy
Copy link

Thanks for the reply. I found a workaround with other build steps in the meantime. If anybody is interested:

  • Use a script step to extract the issue id from the branch name ENV['BITRISE_GIT_BRANCH'] with a regex and write it to a new environment variable using system("envman add --key JIRA_ISSUE_ID --value '#{issueId}'")
  • Use the step Update JIRA issues field to set the Jira field using the new variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants