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

Set WorktreeRoot to sync root outside git repo #2197

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

denik
Copy link
Contributor

@denik denik commented Jan 20, 2025

Changes

If git is not detected, set default worktree root to sync root. Otherwise NewFileSet/View raise an error about worktree root being outside view root in acceptance/bundle/sync-paths-dotdot.

This behavior is introduced in #1945

Stacked on #2202

Tests

Existing tests.

@denik
Copy link
Contributor Author

denik commented Jan 20, 2025

Note, cmd/sync/sync.go might have a similar problem, not addressed here.

@denik denik marked this pull request as draft January 21, 2025 07:40
Base automatically changed from denik/test-root-outside to main January 21, 2025 11:55
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

I understand now -- this is only an issue if we cannot fetch Git metadata, i.e. when working without Git or on an extracted archive of a repo. Very subtle. Glad we can more easily catch this class of problem through acceptance tests in the future.

@denik denik force-pushed the denik/fix-sync-root-validation branch from 745b7c9 to a0cd1a9 Compare January 22, 2025 09:48
@denik denik temporarily deployed to test-trigger-is January 22, 2025 09:48 — with GitHub Actions Inactive
@denik denik force-pushed the denik/fix-sync-root-validation branch from a0cd1a9 to f1884b7 Compare January 22, 2025 09:58
@denik denik temporarily deployed to test-trigger-is January 22, 2025 09:58 — with GitHub Actions Inactive
@denik denik marked this pull request as ready for review January 22, 2025 10:05
@denik denik requested a review from pietern January 22, 2025 10:07
@denik denik changed the base branch from main to denik/sync-root-test January 22, 2025 10:07
@pietern pietern changed the title Outside of git repo, set WorktreeRoot to sync root Set WorktreeRoot to sync root outside git repo Jan 22, 2025
Base automatically changed from denik/sync-root-test to main January 22, 2025 10:23
@denik denik force-pushed the denik/fix-sync-root-validation branch from f1884b7 to fc56d15 Compare January 22, 2025 10:31
@denik denik temporarily deployed to test-trigger-is January 22, 2025 10:31 — with GitHub Actions Inactive
@denik denik enabled auto-merge January 22, 2025 10:42
@denik denik added this pull request to the merge queue Jan 22, 2025
Merged via the queue into main with commit e990203 Jan 22, 2025
9 checks passed
@denik denik deleted the denik/fix-sync-root-validation branch January 22, 2025 10:56
andrewnester added a commit that referenced this pull request Jan 23, 2025
CLI:
 * Added text output templates for apps list and list-deployments ([#2175](#2175)).
 * Fix duplicate "apps" entry in help output ([#2191](#2191)).

Bundles:
 * Allow yaml-anchors in schema ([#2200](#2200)).
 * Show an error when non-yaml files used in include section ([#2201](#2201)).
 * Set WorktreeRoot to sync root outside git repo ([#2197](#2197)).
 * fix: Detailed message for using source-linked deployment with file_path specified ([#2119](#2119)).
 * Allow using variables in enum fields ([#2199](#2199)).
 * Add experimental-jobs-as-code template ([#2177](#2177)).
 * Reading variables from file ([#2171](#2171)).
 * Fixed an apps message order and added output test ([#2174](#2174)).
 * Default to forward slash-separated paths for path translation ([#2145](#2145)).
 * Include a materialized copy of built-in templates ([#2146](#2146)).
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2025
CLI:
* Added text output templates for apps list and list-deployments
([#2175](#2175)).
* Fix duplicate "apps" entry in help output
([#2191](#2191)).

Bundles:
* Allow yaml-anchors in schema
([#2200](#2200)).
* Show an error when non-yaml files used in include section
([#2201](#2201)).
* Set WorktreeRoot to sync root outside git repo
([#2197](#2197)).
* fix: Detailed message for using source-linked deployment with
file_path specified
([#2119](#2119)).
* Allow using variables in enum fields
([#2199](#2199)).
* Add experimental-jobs-as-code template
([#2177](#2177)).
* Reading variables from file
([#2171](#2171)).
* Fixed an apps message order and added output test
([#2174](#2174)).
* Default to forward slash-separated paths for path translation
([#2145](#2145)).
* Include a materialized copy of built-in templates
([#2146](#2146)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants