Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Checking out a Git project does something strange

Hi,

I am trying to integrate Sentry CLI into my CI/CD workflow.

Once everything builds, I send artifacts to Sentry. Sentry will look at the Git log to see what changed since last release.

The problem is, Sentry complains because it cannot match the remote Git repo. When i run git remote -v inside the plan folder, it shows me a local file directory instead of my remote hosted repo on Bitbucket.

 

So Sentry complains with:

DEBUG   2019-03-15 16:52:01.492404779 +07:00   not a match: file:///media/user/external/bamboo/xml-data/build-dir/_git-repositories-cache/debbfac5447105f03d2e672cc6b40afd775f0a46 != https://bitbucket.org/uberdevelopment/uber-spa

1 answer

1 accepted

1 vote
Answer accepted

Hi @Bjorn Harvold

This is indeed expected behavior.

Bamboo does use cache repositories for better scalability. Multiple plans can use the same repository, therefore, saving network bandwidth. There are other reasons for this that I would not be the better person to explain.

In the repository advanced configuration, you will see that we can disable caching on remote agents, but this will still not solve your issue. The Bamboo server will still have the cache.

There are some articles written to provide alternatives for users trying to commit and push during a build. You will be able to see in those articles that the remote URL is manually configured:

What I suggest as a workaround for you is manually configuring the remote repository as performed on those articles.

Hi Daniel,

Thank you for your feedback.

 

Specifically for my purposes, you are suggesting that I add a remote like so:

git remote add central https://username:${bamboo_bitbucket_password}@bitbucket.org/path/to/reponame.git

 

Sentry is failing when it tries to verify that the repo is indeed the repo at origin. Will adding another remote fix that?

 

Cheers

I don't really know Sentry, what I know is that Sentry seems to expect the local repository to be pointing to the main repository directly. If this is the case, setting the remote should fix the issue or at least move you forward. 

Let's give it a try and check what happens.

Hi Daniel,

 

I added a remote as I wrote above. It shows up as central, above origin, when I do a "git remote -v".

 

central https://<hidden>:<hidden>@bitbucket.org/uberdevelopment/uber-spa (fetch)
central https://<hidden>:<hidden>@bitbucket.org/uberdevelopment/uber-spa (push)
origin file:///media/user/external/bamboo/xml-data/build-dir/_git-repositories-cache/c0db605baf9e80f875cbed09008f36a37fe6f6f2 (fetch)
origin file:///media/user/external/bamboo/xml-data/build-dir/_git-repositories-cache/c0db605baf9e80f875cbed09008f36a37fe6f6f2 (push)

 

But it is not being picked up by Sentry. Sentry logs are still only comparing origin entry.

Hi @Bjorn Harvold

Like I shared before, I'm not sure how Sentry works. I just shared a suggestion to set the remote repository configuration once I know that Bamboo uses a shared repository.

I think that you should try seeking for Sentry direct support. This seems to be their channel https://sentry.io/contact/support/.

Hi Daniel,

I do believe this is a Bamboo issue if it does something to the Git remote repository to not point at the original remote origin. It's not expected Git behavior and not a use case I think Sentry could anticipate.

What happens if I set remote origin back to its original Bitbucket location? Will Bamboo barf?

Thanks

Hi @Bjorn Harvold

I shared two links with you. In the first one, the solution comes from setting a central repository. In the second one, it comes from setting a new origin.

What happens if I set remote origin back to its original Bitbucket location? Will Bamboo barf?

I don't think that is a big deal, it should work in my opinion. I just share a warning that it might affect the new commit/push tasks added in latest versions of Bamboo.

Do you want to try this and share here what you get?

Hi Daniel,

 

Thank you for the feedback. So I set the origin to Bitbucket then tried to run a build. The build immediately succeeded and nothing happened. I tried adding the local Git repo, that Bamboo creates, as central but still nothing. My current setup is like this:

 

central file:///media/user/external/bamboo/xml-data/build-dir/_git-repositories-cache/c0db605baf9e80f875cbed09008f36a37fe6f6f2 (fetch)
central file:///media/user/external/bamboo/xml-data/build-dir/_git-repositories-cache/c0db605baf9e80f875cbed09008f36a37fe6f6f2 (push)
origin https://<username>:<password>@bitbucket.org/uberdevelopment/uber-spa (fetch)
origin https://<username>:<password>@bitbucket.org/uberdevelopment/uber-spa (push)

 

Am I missing something?

 

Thoughts?

Hi @Bjorn Harvold

Have you tried leaving only the origin configured?
I don't know how Sentry works and extra entries might be confusing it.

Maybe it worths a try.

Hi Daniel,

 

The job never gets that far. Bamboo stops working a few seconds after I start it whether I have only origin or origin and central remotes configured. Thinking it doesn't like that the local cached version of the repo isn't origin.

 

Thoughts?

I think you are right, the checkout task may be expecting something different from the git repository configuration.

Thoughts?

Yes, please try to check the option Force Clean Build in your source code checkout task or add the task Clean working directory at the beginning of your job. That should work around this problem.

Hi Daniel,

 

When I Force Clean Build, Bamboo removes the git remote I manually added through the console and resets Git back to how Bamboo likes it.

 

Sentry works if I set git origin while the job is building. Pretty hacky but I could run a script that sets git remote origin every time.

 

Any better suggestions?

Hi @Bjorn Harvold

That is the way I see it could work, still using the Bamboo checkout task. Yes, you will need to change the origin of every build.

Other option would be cloning the repository manually using a script task and taking control of the whole process involving the git repository.

Please keep in mind that the checkout task is supposed to provide you with the repository source code, and that is the way Bamboo does to make it scalable. There is no right and wrong on how to clone a source, but if you think this should be done differently, please create a feature request in our issue system https://jira.atlassian.com/issues/ and share your reasons there. Our developers will be happy to have your feedback.

Hi Daniel,

 

Yes that's what I did. Working :-) Thank you for your patience and help.

 

Cheers!

Like Daniel Santos likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

243 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you