Closed katinthehatsite closed 1 week ago
A note that I noticed that sometimes CLI output could be strange - for instance, I asked the Chat Assistant to give me CLI commands and it suggested the following but running that command gave strange output that requires action:
We might need to add a better validation of the commands that we want to run to make sure it does not result into the actionable output like this.
@katinthehatsite nice work!
I left some comments/suggestions.
Other than that it works as expected
Note that there are some errors in buildkite/unit-tests
that are related to the new library you introduced.
Something that still needs to be looked into but documenting it here for the reviewers:
Run
button does not go to Run again
once the output is generated. This needs to be adjusted as wellLooking at https://github.com/Automattic/dotcom-forge/issues/7526#issuecomment-2165266623 , let's wait until Monday when we decide if we want to keep the Run
button at all. If not, then we can remove it and otherwise, this PR is ready.
If we decide to keep it, let's fix the two things mentioned above in https://github.com/Automattic/studio/pull/232#issuecomment-2165073454
@katinthehatsite , would be possible to add an horizontal scroll to the code block?
Let's also avoid displaying the Run button if the wp command has some placeholder <
>
.
Hi @sejas, since our conversation earlier this morning, I have done the following:
Run
and Run again
buttons, reused some of the components that we already have and removed the redundant logic;<
and >
characters and disables the Run
button for these commandsThe only other thing I see is that it seems that E2E tests are timing out on Windows 🤔
For the horizontal scroll, I suggest we open a separate issue and handle it in the follow-up. I am not seeing an obvious fix right away and I would prefer to merge the PR asap as it is starting to grow quite large. What do you think?
Let me know what you think of the changes!
Related to https://github.com/Automattic/dotcom-forge/issues/7526
Proposed Changes
This PR adds that dynamic code block that allows to execute CLI commands inside that block. It also does the following:
Run
button is disabled for code blocks that don't have CLI commandsTesting Instructions
STUDIO_AI=true npm start
Run
buttonPre-merge Checklist