G-Node / tonic

Framework for building services that interact with GIN
BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

utonics/labproject: use relative URLs in .gitmodules #40

Closed achilleas-k closed 2 years ago

achilleas-k commented 2 years ago

Create relative URLs for the new submodules and write them back to the .gitmodules file. This makes working with submodules much more flexible since it works for both git and http remotes, depending on how the parent repository is cloned. It also gets around any issues with linking in the GIN web interface.

@jcolomb please test it and let me know how it works for you.

codecov[bot] commented 2 years ago

Codecov Report

Merging #40 (df489ff) into JC_debugsubmodule (28dded2) will not change coverage. The diff coverage is n/a.

@@                Coverage Diff                 @@
##           JC_debugsubmodule      #40   +/-   ##
==================================================
  Coverage              57.59%   57.59%           
==================================================
  Files                      8        8           
  Lines                    474      474           
==================================================
  Hits                     273      273           
  Misses                   166      166           
  Partials                  35       35           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 28dded2...df489ff. Read the comment docs.

jcolomb commented 2 years ago

Seems to work: https://gindata.biologie.hu-berlin.de/testtonic/testachilleastrick. But: tonic does have an error message:

Uploading submodule to new project repository
Upload failed: git-annex: First run: git-annex init 

It is the same error I had using the git set-url function (which did not change the .gitmodule file)

I did not get to understand the branch issues.

jcolomb commented 2 years ago

Adding submoduleForEach("gin", "init") in line 247 did the trick, but now it fails with

Failed to add repository "testing-gininit3.06_disseminations/02_manuscript" to team: 404 Not Found

Problem found on line 351: repoName := project + "." + strings.ReplaceAll(smName, "/", "_")

and now it works

jcolomb commented 2 years ago

So I added some changes to make it work without errors, could not make an extra branch, so commited directly (I did not think I could do that, but it worked...)

gin init run on each submodules os.Chdir(localRepoPath) instead of os.Chdir(..) smname was incorrect l. 351

Now it works, apparently without a hindernis.

achilleas-k commented 2 years ago

How does it work? The commit you added doesn't compile.

What do you mean by "the branch issue"?

jcolomb commented 2 years ago

Sorry, I typed something while making a text search without noticing, I think this will do now.

For the branch, there are new code about branch: submodule.branch, that I do not know what it does.

achilleas-k commented 2 years ago

Please use the suggestion function to make recommendations for changes. It's easier to review and discuss and keeps the git history cleaner.

jcolomb commented 2 years ago

Does not work when the changes to make are not in the changes you did. I will take the time to make a fork next time, sorry for the bother. (aiming at quick fixes are indeed never an efficient way to work... )

achilleas-k commented 2 years ago

Converted to draft to clean up and test additional changes.

jcolomb commented 2 years ago

apparently, the gin init on submodule is tricky, as it is not working with https://gindata.biologie.hu-berlin.de/G-Node/template_2, will look into it again. I may be a docker issue (I did not use docker for my earlier test, when it worked) note that the repo is still created, but tonic fail before adding the repo to the team.

log:

05. Cloning submodules
06. Failed to run command "gin init" in all submodules: exit status 128

and the terminal:

Entering '06_dissemination/02_manuscripts'
path='06_dissemination/02_manuscripts'; gin init: line 1: gin: not found
fatal: run_command returned non-zero status for 06_dissemination/02_manuscripts
.
jcolomb commented 2 years ago

close this one as the other PR is more advanced. will need to work there on ways to make subodules updates in tonic (sync script workaround works there #39 )

jcolomb commented 2 years ago

ok, checked again all changes were included in the other PR.