Skip to content

Passing commit references to config.show doesn't work as expected #3649

Closed

Description

@lorenzo-cavazzi

Describe the bug
The GET /config.show endpoint has a parameter called branch that (thanks to #3579) should accept all valid references.
It doesn't seem to work correctly. Here is an example that should return 0 CPU instead of 8 CPU
https://dev.renku.ch/ui-server/api/renku/10/config.show?branch=b44d8b8bca27d5e0c271083c57b17861ef370624&git_url=https%3A%2F%2Fgitlab.dev.renku.ch%2Fflora.thiebaut%2Fa-playground-project
Using the branch (test-settings) also leads to the same result; it seems that the field is ignored.

Link to project
If possible, provide a public renkulab link to the project with the bug.

To Reproduce
Use the link above; the project is just an example. It should be easy to reproduce this by playing around with the project config.

Run environment (please complete the following information):
Tested on dev.renku.ch where the renku-core version is v2.7.0

Activity

  1. Panaetius commented on Nov 8, 2023

    @Panaetius
    Member

    @lorenzo-cavazzi the branch field only accepts branches (as per the name), use the commit_sha field (in the PR you linked https://github.com/SwissDataScienceCenter/renku-python/pull/3608/files#diff-ec6227d8ba49d96645055b9405410a0fe9b7bb4b259bfbb369afde37b98e2a26R42-R43 )
    Also note that this is not yet released, so wouldn't work on the dev deployment.

  2. lorenzo-cavazzi commented on Nov 8, 2023

    @lorenzo-cavazzi
    MemberAuthor

    I tried the commit_sha parameter on the develop branch, but I still got the same problem

    P.S. The link probably won't work anymore in a few days from now, just update it with a working deployment

    https://renku-ci-ui-2854.dev.renku.ch/ui-server/api/renku/10/config.show?commit_sha=b44d8b8bca27d5e0c271083c57b17861ef370624&git_url=https%3A%2F%2Fgitlab.dev.renku.ch%2Fflora.thiebaut%2Fa-playground-project

    image

  3. Panaetius commented on Nov 29, 2023

    @Panaetius
    Member

    i tested this on the same deployment with newest develop which has some fixes for the internal cache and everything worked as expected. closing this issue

  4. moved this from Backlog to Done in renku-pythonon Nov 29, 2023
  5. leafty commented on Dec 18, 2023

    @leafty
    Member

    The endpoint does not work for anonymous users:

    {"error":{"code":1010,"devMessage":"Repository not found. Git error message: stderr: 'cloning into '/tmp/tmp0249ujrt'... warning: redirecting to https://gitlab.dev.renku.ch/flora.thiebaut/a-playground-project.git/ post git-upload-pack (568 bytes) warning: could not find remote branch acd42ec5661190e0012d0d8e7e21eea5aefdb333 to clone. fatal: remote branch acd42ec5661190e0012d0d8e7e21eea5aefdb333 not found in upstream origin '","devReference":"https://renku-python.readthedocs.io/en/latest/service_errors.html#renku.ui.service.errors.UserRepoUrlInvalidError","userMessage":"A valid Git repository is not available at the target URL, or the user does not have the required permissions to access it."}}

    Endpoint:

    /ui-server/api/renku/10/config.show?git_url=https%3A%2F%2Fgitlab.dev.renku.ch%2Fflora.thiebaut%2Fa-playground-project&branch=acd42ec5661190e0012d0d8e7e21eea5aefdb333
    
  6. reopened this on Dec 18, 2023
  7. Panaetius commented on Dec 18, 2023

    @Panaetius
    Member
    fatal: remote branch acd42ec5661190e0012d0d8e7e21eea5aefdb333 not found in upstream origin
    

    seems the branch doesn't exist? there shouldn't be a reason for it failing for anonymous users unless the repo isn't public. you might be passing in a commit in the branch field instead of the commit_sha field?

  8. leafty commented on Dec 18, 2023

    @leafty
    Member

    Oh sorry, I don't know why I used branch=.

    The problem still remains though, I get different answers if I use a logged in session or an anonymous session:

    Logged in:

    https://dev.renku.ch/ui-server/api/renku/10/config.show?git_url=https%3A%2F%2Fgitlab.dev.renku.ch%2Fjohann.thiebaut1%2Fanother-playground-project&commit_sha=a5dc1ae5cda2ecd5ab70ceafa799603e9d76cdd4
    
    {"result":{"config":{"interactive.cpu_request":"10","interactive.default_url":"/lab","renku.autocommit_lfs":"false","renku.check_datadir_files":"true","renku.lfs_threshold":"100kb"},"default":{"interactive.default_url":"/lab","renku.autocommit_lfs":"false","renku.check_datadir_files":"true","renku.lfs_threshold":"100kb"}}}

    Anonymous:

    https://dev.renku.ch/ui-server/api/renku/10/config.show?git_url=https%3A%2F%2Fgitlab.dev.renku.ch%2Fjohann.thiebaut1%2Fanother-playground-project&commit_sha=a5dc1ae5cda2ecd5ab70ceafa799603e9d76cdd4
    
    {"result":{"config":{"interactive.cpu_request":"0.4","interactive.default_url":"/lab","interactive.disk_request":"4G","interactive.mem_request":"1G","renku.autocommit_lfs":"false","renku.check_datadir_files":"true","renku.lfs_threshold":"100kb"},"default":{"interactive.default_url":"/lab","renku.autocommit_lfs":"false","renku.check_datadir_files":"true","renku.lfs_threshold":"100kb"}}}
  9. Panaetius commented on Dec 18, 2023

    @Panaetius
    Member

    does this eventually converge or persist? could be a caching issue.

  10. leafty commented on Dec 18, 2023

    @leafty
    Member

    It doesn't seem so.

  11. leafty commented on Dec 18, 2023

    @leafty
    Member

    The anonymous responses seem incorrect

  12. Panaetius commented on Dec 19, 2023

    @Panaetius
    Member

    i checked and this wasn't implemented for the anonymous code path. we'll address that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/bugstatus/triage

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions