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

Add support for optional paths #472

Merged
merged 14 commits into from
Apr 19, 2022
Merged

Conversation

Quenty
Copy link
Contributor

@Quenty Quenty commented Aug 26, 2021

Closes #383 by adding the fields "path": "src" or "path": { "optional": "src" } which indicates that the path is optional. Also adds a unit test by @MobiusCraftFlip adjusted for this format.

I recommend reviewing this PR commit-by-commit for clarity.

This pull request enables scenarios with node_modules and other tools that sometimes create folders and sometimes does not.

Copy link
Member

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Left a few comments, mostly about Rust stuff

src/snapshot_middleware/project.rs Outdated Show resolved Hide resolved
src/project.rs Outdated Show resolved Hide resolved
src/project.rs Outdated Show resolved Hide resolved
src/project.rs Outdated Show resolved Hide resolved
src/snapshot_middleware/project.rs Outdated Show resolved Hide resolved
rojo-test/build-tests/optional/out.rbxmx Outdated Show resolved Hide resolved
src/snapshot_middleware/project.rs Outdated Show resolved Hide resolved
@Quenty
Copy link
Contributor Author

Quenty commented Aug 27, 2021

Note: This PR is designed to be merged as a semi-linear merge, or more likely, a regular merge. This will preserve commit history.

@Quenty Quenty requested a review from LPGhatguy August 27, 2021 02:16
src/path_serializer.rs Outdated Show resolved Hide resolved
src/project.rs Outdated Show resolved Hide resolved
src/project.rs Outdated Show resolved Hide resolved
src/snapshot_middleware/project.rs Outdated Show resolved Hide resolved
src/snapshot_middleware/project.rs Outdated Show resolved Hide resolved
src/project.rs Outdated Show resolved Hide resolved
src/project.rs Outdated Show resolved Hide resolved
src/snapshot_middleware/project.rs Outdated Show resolved Hide resolved
src/snapshot_middleware/project.rs Outdated Show resolved Hide resolved
@LPGhatguy
Copy link
Member

I would not worry about preserving commit history here. Reviewing and merging PRs commit-by-commit is usually only helpful for incremental refactors, large changes, or a mix of mechanical and manual changes. I don't think this PR qualifies, and I have been reviewing it as a single chunk.

…e defined either as `"$path": "src"` or `"$path": { "optional": "src" }`
Copy link
Member

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

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

Digging the latest round of changes!

It looks like there's a test failure, make sure you commit your updated Insta snapshot tests.

This should be the last feedback from me. If everything works from here, then I think we're good to go. I'd appreciate it if you would also file a PR on https://github.com/rojo-rbx/rojo.space with documentation updates! 😊

src/snapshot/patch_compute.rs Outdated Show resolved Hide resolved
@Quenty
Copy link
Contributor Author

Quenty commented Sep 7, 2021

I'll be taking a look at this today, sorry for the delay.

@LPGhatguy LPGhatguy dismissed their stale review November 20, 2021 23:00

Iterating to merge this in for 7.0 stable

Copy link
Member

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

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

Going through with merging this, and opened an issue about the remaining issue.

@LPGhatguy LPGhatguy merged commit fe81e55 into rojo-rbx:master Apr 19, 2022
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
* Add PathNode with optional fields to project. This allows a path to be defined either as `"$path": "src"` or `"$path": { "optional": "src" }`

* Make $path truly optional

* Prevent rojo from erroring if no project node is resolved

* Use match instead of if-statement

* Add end-to-end tests (credit to MobiusCraftFlip for initial scenario)

* Pass option with ref inside instead of reference to option

* Empty commit to restart GitHub Actions

* Simplify build test

* Minimize serve test: it fails

* Simplify serve test even more

* Ignore failing serve test

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
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.

Support for Optional Tree Nodes
3 participants