Repository navigation
Redirect health check - #1340
Conversation
… between external execution interfaces.
Mpdreamz
left a comment
There was a problem hiding this comment.
Nitpicky changes but functionally and code wise this LGTM !
|
|
||
| public partial class LocalGitRepositoryTracker(DiagnosticsCollector collector, IDirectoryInfo workingDirectory) : ExternalCommandExecutor(collector, workingDirectory), IRepositoryTracker | ||
| { | ||
| public IEnumerable<string> GetChangedFiles(string lookupPath) |
There was a problem hiding this comment.
I think it'd be good if we include the type of change and e.g the target.
e.g if I have the following staged changes:
R docs/configure/site/landing-page.md -> docs/configure/site/landing-page-2.md
the error message is:
Error: docs/configure/site/landing-page.md does not have a redirect rule set. Please add a redirect rule in this project's _redirects.yml.
NOTE: docs/configure/site/landing-page.md
Where the file we want to report on is the current renamed file landing-page-2.md.
It would also be good for the error to be descriptive to the type of change.
- File 'x' was deleted but has no redirect targets, this will lead to broken links.
- File 'x' was renamed to 'y' but has 'x' has no redirect configuration.
Error: docs/configure/site/landing-page.md does not have a redirect rule set. Please add a redirect rule in this project's _redirects.yml.
NOTE: docs/configure/site/landing-page.md
I think the file to include in the diagnostics should be _redirects.yml file since that is the file causing the error.
There was a problem hiding this comment.
Having all the renames will also make it easier to feed all the renames into docs-builder mv through docs-builder diff apply in a follow up :)
There was a problem hiding this comment.
Another note we can detect local unstaged renames using
git stash push -- docs
git stash show --name-status
git stash pop
There was a problem hiding this comment.
Another note we can detect local unstaged renames using
git stash push -- docs git stash show --name-status git stash pop
I think only this change remains!
… to make clearer reporting.
Mpdreamz
left a comment
There was a problem hiding this comment.
Thanks for adding local changes too, small nitpick left but LGTM!
| var defaultBranch = GetDefaultBranch(); | ||
| var commitChanges = CaptureMultiple("git", "diff", "--name-status", $"{defaultBranch}...HEAD", "--", $"./{lookupPath}"); | ||
| var localChanges = CaptureMultiple("git", "status", "--porcelain"); | ||
| _ = Capture("git", "stash", "push", "--", $"./{lookupPath}"); |
There was a problem hiding this comment.
| _ = Capture("git", "stash", "push", "--", $"./{lookupPath}"); | |
| ExecIn([], "git", "stash", "push", "--", $"./{lookupPath}"); |
| var localChanges = CaptureMultiple("git", "status", "--porcelain"); | ||
| _ = Capture("git", "stash", "push", "--", $"./{lookupPath}"); | ||
| var localUnstagedChanges = CaptureMultiple("git", "stash", "show", "--name-status", "-u"); | ||
| _ = Capture("git", "stash", "pop"); |
There was a problem hiding this comment.
| _ = Capture("git", "stash", "pop"); | |
| ExecIn([], "git", "stash", "pop"); |
Closes #759
This PR introduces a new subcommand for
docs-builderunderdiff:validate. An optional parameter can be used to define the base path of the documentation folder.docsis the default.As we have different interfaces on both
builderandassemblernow that leverage external commands, I saw fit to do a minor refactoring and move the functionality to a base class, and extended it to serve multiple-line outputs as well.