-
Notifications
You must be signed in to change notification settings - Fork 21
Redirect health check #1340
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
Redirect health check #1340
Conversation
src/tooling/Elastic.Documentation.Tooling/ExternalCommands/ExternalCommandExecutor.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments!
… between external execution interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes
… to make clearer reporting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ = 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ = Capture("git", "stash", "pop"); | |
ExecIn([], "git", "stash", "pop"); |
Closes #759
This PR introduces a new subcommand for
docs-builder
underdiff
:validate
. An optional parameter can be used to define the base path of the documentation folder.docs
is the default.As we have different interfaces on both
builder
andassembler
now 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.