Hello Bitbucket community,
I'm experiencing an issue where the Bitbucket Cloud API returns conflict markers in Pull Request diffs that have no actual conflicts.
Endpoint used:
GET /2.0/repositories/{workspace}/{repo_slug}/commits/{spec}/diff
Parameters:
spec: {commit_hash_1}..{commit_hash_2} (two-dot format)path: specific file pathWhat's happening:
The API returns content with Git conflict markers like:
<<<<<<< destination:a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0
const API_TIMEOUT = 5000;
const MAX_RETRIES = 3;
=======
const API_TIMEOUT = 3000;
const MAX_RETRIES = 5;
>>>>>>> source:9z8y7x6w5v4u3t2s1r0q9p8o7n6m5l4k3j2i1h0
Important context:
Questions:
Thank you for your attention!
Can you please provide the full cURL command you're executing (with authentication/repo slug location hashed out)?
Cheers!
- Ben (Bitbucket Cloud Support)
Hey Ben!
Sorry for the delay in responding, I was away from work.
Is there any other way you can help me with this? It's just that the credentials are from a client who uses our code review platform
Could you send it by email so it doesn't stay registered here in the community post?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are unfortunately able to offer support via email. Are you able to completely remove the auth credentials and just replace with a placeholder like "username:AppPassword"? These aren't needed, I'm more so interested in the actual content of the command that's being executed.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it, Ben. Thanks for the help. I'll send you the code snippets where we're building the file diffs.
First we fetch the PR data and the PR files, as you can see in this snippet below:
Our project is open source, so you can view the complete code we're using in the link below. The method where we fetch the code diff is getFilesByPullRequestId
[REDACTED]
I know you asked for the URLs, but our calls are made in this format. I tried to get the URLs by going into the Bitbucket modules, but everything is encrypted. Can you help me by analyzing it in this format?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This appears to be Javascript code. Unfortunately, we can't assist with any code-related queries such as this, as it falls outside of our support scope (even for paid customers) - this includes analysis/interpretation of that code.
I'd suggest adding a method to print the exact API calls that are performed, as we'll need these to try to reproduce the issue on our side.
Thank you for your understanding.
Regards,
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.