Properly read Git metadata when running inside workspace#1945
Merged
Conversation
17f284e to
84d535a
Compare
8729c19 to
05ff508
Compare
Base automatically changed from
DECO-24125--move-git-load-to-initialize
to
main
December 2, 2024 09:54
05ff508 to
c3b02d9
Compare
andrewnester
reviewed
Dec 3, 2024
andrewnester
approved these changes
Dec 3, 2024
Contributor
andrewnester
left a comment
There was a problem hiding this comment.
Approved but please take a look at integration tests failures on Windows before merging
It seems that because vfs.Path does filepath.Abs (OS-specific) transformation that mangles the path even when it's already in good state, e.g. /Workspace/Something and that causes the tests to fail on Windows.
pietern
reviewed
Dec 4, 2024
Contributor
|
These are minor comments. Core of the PR LGTM! |
Co-authored-by: Pieter Noordhuis <[email protected]>
pietern
approved these changes
Dec 5, 2024
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Collaborator
|
Test Details: go/deco-tests/12176323188 |
This was referenced Jan 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Since there is no .git directory in Workspace file system, we need to make an API call to api/2.0/workspace/get-status?return_git_info=true to fetch git the root of the repo, current branch, commit and origin.
Added new function FetchRepositoryInfo that either looks up and parses .git or calls remote API depending on env.
Refactor Repository/View/FileSet to accept repository root rather than calculate it. This helps because:
Tests