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

Remove ./ when getting file in GitLab #844

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

lbarcziova
Copy link
Member

@lbarcziova lbarcziova commented Feb 28, 2024

So that the behaviour is consistent among forges. GitLab cannot do this automatically (confirmed that both GitHub and Pagure can).

Related to #838

RELEASE NOTES BEGIN

GitLabProject.get_file_content can now correctly handle file paths starting with ./.
RELEASE NOTES END

Copy link
Contributor

@lbarcziova lbarcziova self-assigned this Feb 28, 2024
@@ -361,6 +362,8 @@ def get_branches(self) -> list[str]:

def get_file_content(self, path, ref=None) -> str:
ref = ref or self.default_branch
# GitLab cannot resolve './'
path = os.path.normpath(path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking for this function, but everything I managed to find on the Path class was impure /o And this (at least documentation doesn't say a thing) is pure, but under the os module /o\ This language is a mess…

@lbarcziova lbarcziova added the mergeit When set, zuul wil gate and merge the PR. label Mar 1, 2024
Copy link
Contributor

So that the behaviour is consistent among forges. GitLab
cannot do this automatically.

Related to packit#838
Copy link
Contributor

@lbarcziova
Copy link
Member Author

regate

Copy link
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/packit-service/buildset/4c73a0e62949451e8b0c6e07566709de

✔️ pre-commit SUCCESS in 2m 31s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 50b02cb into packit:main Mar 4, 2024
28 checks passed
@lbarcziova lbarcziova deleted the paths-dot branch March 4, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mergeit When set, zuul wil gate and merge the PR.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants