packit / ogr

One Git library to Rule -- one API for many git forges
MIT License
50 stars 55 forks source link

Resolving paths #838

Closed mfocko closed 8 months ago

mfocko commented 9 months ago

What happened? What is the problem?

GitLab fails to resolve . and (potentially) .. in the paths, this resulted in not triggering the TF runs.

Possibly affected methods (as TODO list with confirmed as ticked):

What did you expect to happen?

ogr to ignore the . and .. where applicable

Example URL(s)

Example of sanitization: https://github.com/packit/packit-service/blob/7337498d73eed935e6196696a518d3ea69ef4ad7/packit_service/worker/helpers/testing_farm.py#L191-L202

This could be probably done in a more generic way in the packit-service, that's open for discussion. The linked sanitization is not enough IMO…

Steps to reproduce

import os
from ogr import GitlabService

gs = GitlabService(token=os.getenv("GITLAB_TOKEN"))
p = gs.get_project(namespace="efedin", repo="compose-tests")

# generated via f-string in Packit Service
print(p.get_file_content(path="./.fmf/version", ref="84d980d")

# without the `.` prefix
print(p.get_file_content(path=".fmf/version", ref="84d980d")

Workaround

Participation

majamassarini commented 9 months ago

In ogr we want the same behaviour for github, gitlab and pagure. Fix it in packit if this will change the behaviour for gitlab in ogr.

lbarcziova commented 8 months ago

PullRequest.comment() is not affected as filename there is not event considered for GitLab, closing.