regression: remote-build fails when project is not in a git directory
Metadata
Current evaluation
Closed as intentional: remote-build requires an existing Git repo to prevent reuse of local parts/stage/prime; merged PR #4536 (bc1c5537a) clarified the error and docs.
Resolution: closed not a bug
Reason: Maintainers confirmed the existing-repository requirement was intentional because auto-initializing Git could include parts, stage, and prime, allowing remote builds to reuse local work. PR #4536, merged as bc1c5537a, improved the error messages and documentation.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
In snapcraft 8.0.1, remote-build is now failing if the project is not in a git repository.
This failure is occurring in the weekly spread tests: https://github.com/snapcore/snapcraft/actions/runs/7469897740/job/20327823910#step:5:36
[This check](https://github.com/snapcore/snapcraft/blob/ffbdabf53de21606d9d12e15f16d4bca5e4423a5/snapcraft/remote/git.py#L88) is causing snapcraft to fail and preempts all the code that automatically initializes a git repository in the temporary work directory.
### To Reproduce
```
mkdir tmp
pushd tmp
snapcraft init
snapcraft remote-build
popd
```
### Environment
n/a
### snapcraft.yaml
```shell
n/a
```
### Relevant log output
```shell
2024-01-10 03:26:29.754 remote-build error: The Git repository is invalid for remote build.
Could not find a git repository in '.'
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed not a bug | Closed as intentional: remote-build requires an existing Git repo to prevent reuse of local parts/stage/prime; merged PR #4536 (bc1c5537a) clarified the error and docs. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as intentional: remote-build requires a top-level Git repository to prevent reuse of local parts, stage, and prime directories. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as intentional: remote-build requires an existing Git repository. PR #4536 (bc1c5537a) clarified the Git error and documentation; automatic initialization was not restored. | |
| stealth/space-bunny-alpha | — | closed not a bug | Closed as intentional: remote-build requires an existing Git repository so local parts, stage, and prime directories cannot be reused remotely. Test and error-message improvements were deferred. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as intentional. The check prevents local build artifacts from polluting remote builds. Resolution involves updating the failing spread test and improving the error message instead of reverting the behavior. | |
| qwen/qwen3.6-35b-a3b | — | — | The regression was intentionally retained to prevent build artifacts from polluting auto-initialized repositories. The issue was closed, with plans to adjust the failing spread test and improve the error message. | |
| qwen/qwen3.6-35b-a3b | — | — | Rejected as a bug. The git validation prevents local build artifacts from polluting remote environments. Resolution involves updating the failing spread test and improving the error message rather than reverting the change. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed as intentional behavior. The check prevents dirty local build directories from contaminating remote builds. The team will adjust the failing spread test and improve the error message instead of reverting the change. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/snapcraft#4536
(confidence 99%)
Merged PR that rewording Git errors and documenting the requirement; it explicitly fixes #4517.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #310 fix(remote-build): enable git repo check | craft-application | merged | Merged PR #310 in commit 28429b84, enabling remote builds to check Git cleanliness before staging and committing copied project changes. |