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

feat(git): add subdir support to GitReference #12131

Merged
merged 6 commits into from
Dec 17, 2024
Merged

feat(git): add subdir support to GitReference #12131

merged 6 commits into from
Dec 17, 2024

Conversation

hsheth2
Copy link
Collaborator

@hsheth2 hsheth2 commented Dec 13, 2024

  • Add subdir field to GitReference class for specifying subdirectory
  • Update get_url_for_file_path to handle subdir correctly
  • Add test cases for both GitHub and GitLab URL generation

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

devin-ai-integration bot and others added 5 commits December 13, 2024 03:07
- Add subdir field to GitReference class for specifying subdirectory
- Update get_url_for_file_path to handle subdir correctly
- Add test cases for both GitHub and GitLab URL generation

Co-Authored-By: [email protected] <[email protected]>
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Dec 13, 2024
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Dec 13, 2024
git_ref = GitReference(repo="https://gitlab.com/org/repo", url_subdir="dbt")
assert (
git_ref.get_url_for_file_path("model.sql")
== "https://gitlab.com/org/repo/-/blob/main/dbt/model.sql"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with gitlab and this - in the middle called my attention.

Apparently, the dashless variant also works https://gitlab.com/gitlab-org/gitlab/-/issues/365984

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

huh interesting

The /-/ stuff was already in there, and given that it still works, I don't think it makes sense to change right now

Copy link
Contributor

@sgomezvillamor sgomezvillamor left a comment

Choose a reason for hiding this comment

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

LGTM

@datahub-cyborg datahub-cyborg bot added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Dec 17, 2024
@hsheth2 hsheth2 merged commit d5ab001 into master Dec 17, 2024
99 of 101 checks passed
@hsheth2 hsheth2 deleted the hs--cus-3397 branch December 17, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata pending-submitter-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants