#Git Submodules

31 messages · Page 1 of 1 (latest)

blissful grotto
#

How can I add commits from submodules to a release?

Do I just run git submodule foreach "sentry-cli releases -p <PROJECT> set-commits <PROJECT>@<SEMVER> --auto" ?

surreal perch
#

I honestly doubt --auto will work here but have you tried it?

#

I am not sure we support this usecase

blissful grotto
surreal perch
#

yeah I don't think we support this usecase

blissful grotto
#

But you do allow it in sentry's frontend

#

I can add multiple repositories through the gitlab integration and set up code mappings to point at certain submodules

#

So, what would the command do in my OP?

surreal perch
#

I would just try it out and see what happens

blissful grotto
#

Just try it out seems like an unreasonable strategy for production environments tbf

surreal perch
#

😂 not wrong

#

It's a bit uncharted territory for me at least. I would file it under undefined behavior. Maybe @kind badger can chime in.

blissful grotto
#

🫣 any updates?

kind badger
#

Hi @blissful grotto, missed this one, my apologies

Tbh I’m unsure, I’m not really that familiar with git submodules. I’d have to investigate a bit

#

You could try out the command with a test project and see what happens

#

Otherwise I’ll have some time to take a look tomorrow

kind badger
#

Hey @blissful grotto, after reading up on git submodules, it appears that you can use git submodules foreach to execute an arbitrary shell command (such as Sentry CLI) on each of the submodules individually

So, I would expect the command you provided to work. If it does not, please let us know

blissful grotto
kind badger
#

It just sets which commits will be associated with your Sentry release. It does not make any commits

blissful grotto
#

I mean to the release

kind badger
#

Ah okay I think I get it now: you’re wondering if the loop will cause the previous commits associated with the release to be overwritten on that release. Is that correct?

My guess is that the commits most likely get overwritten, which would mean we don’t support your use case, but I’d need to investigate to be sure. You could also just try it out with a test project

Are you all of the sub modules using the same project in Sentry?

kind badger
#

@blissful grotto from what I can tell, calling set-commits would indeed overwrite any commit history for the given release, so the foreach would not work as expected

So, it seems like we do not support this use case

blissful grotto
blissful grotto
kind badger
kind badger
#

Do you think that will be a suitable workaround for you @blissful grotto?

blissful grotto
#

It'll have to, as long as I'll be able to link commits to a repository, obviously

#

Feature request would be support for this though

#

Automatically, in sentry-cli

kind badger
#

Okay! Could you please open a feature request issue on GitHub?