Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect repository caching #8

Closed
janhavlin opened this issue Oct 22, 2024 · 0 comments · Fixed by #9
Closed

Incorrect repository caching #8

janhavlin opened this issue Oct 22, 2024 · 0 comments · Fixed by #9

Comments

@janhavlin
Copy link
Collaborator

I found a bug regarding caching git repositories. I made a query for a repository, then I made another query for a fork of the same repository, but the repository wasn't cloned as it is apparently already cached (even though it was never used yet) and the data displayed were from the wrong repository.

This is how I reproduced it:

  1. I went to http://localhost:8000/?plan-url=https://gitlab.com/janhavlin/tests&plan-name=/testing-farm/sanity, there is status_callback_url.
  2. I went to the callback url http://localhost:8000/status?task-id=3b776cb9-97d0-4c31-ab94-a3beb6e615cf, the result was:
{
  "name": "/testing-farm/sanity",
  "summary": "Testing Farm sanity tests",
  "description": "Collection of Testing Farm sanity tests.\\n",
  "url": "https://gitlab.com/janhavlin/tests/tree/main/testing-farm/sanity.fmf",
  "ref": "main",
  "contact": [],
  "tag": [],
  "tier": null,
  "id": null,
  "fmf-id": {
    "url": "https://gitlab.com/janhavlin/tests",
    "path": null,
    "name": "/testing-farm/sanity",
    "ref": "main"
  }
}
  1. Then I queried a new request http://localhost:8000/?plan-url=https://gitlab.com/non-existent-user/tests&plan-name=/testing-farm/sanity (same repository name but under a different/non existent user).
  2. The result is same as 2.:
{
  "name": "/testing-farm/sanity",
  "summary": "Testing Farm sanity tests",
  "description": "Collection of Testing Farm sanity tests.\\n",
  "url": "https://gitlab.com/janhavlin/tests/tree/main/testing-farm/sanity.fmf",
  "ref": "main",
  "contact": [],
  "tag": [],
  "tier": null,
  "id": null,
  "fmf-id": {
    "url": "https://gitlab.com/janhavlin/tests",
    "path": null,
    "name": "/testing-farm/sanity",
    "ref": "main"
  }
}

From logs:

[celery] | [2024-09-26 11:43:42,633: WARNING/ForkPoolWorker-16] Cloning the repository for url: https://gitlab.com/non-existent-user/tests
[celery] | [2024-09-26 11:43:42,633: WARNING/ForkPoolWorker-16] Parsing the url and name...
[celery] | [2024-09-26 11:43:42,633: WARNING/ForkPoolWorker-16] URL: https://gitlab.com/non-existent-user/tests
[celery] | [2024-09-26 11:43:42,633: WARNING/ForkPoolWorker-16] Name: /testing-farm/sanity
[celery] | [2024-09-26 11:43:42,633: WARNING/ForkPoolWorker-16] Cloning the repository...
[celery] | [2024-09-26 11:43:42,634: WARNING/ForkPoolWorker-16] Repository already cloned!
[celery] | [2024-09-26 11:43:42,634: WARNING/ForkPoolWorker-16] Looking for tree...
[celery] | [2024-09-26 11:43:42,634: WARNING/ForkPoolWorker-16] Tree found!
...
[celery] | [2024-09-26 11:43:42,674: DEBUG/ForkPoolWorker-16] Run command: git config --get remote.origin.url
[celery] | [2024-09-26 11:43:42,674: DEBUG/ForkPoolWorker-16] environment
[celery] | [2024-09-26 11:43:42,675: DEBUG/ForkPoolWorker-16] Command event: 1.114e-06 waiting for process to finish
[celery] | [2024-09-26 11:43:42,675: DEBUG/ForkPoolWorker-16] out: https://gitlab.com/janhavlin/tests
@psss psss linked a pull request Oct 24, 2024 that will close this issue
@psss psss closed this as completed in #9 Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant