Conversation
54e9c99 to
dfaf6c8
Compare
Owner
|
@teggotic please resolve conflicts here |
There is an issue in how we test actions. Fundamentally, we rely on the fact that the `Real` runner is generating `git` calls correctly. This could be neglected in theory, but there is another issue, which forces us to generate "textual" representation of what our command is doing, in multiple places, which leads to code repetition. As a solution to this, I've created 1 data type for every type of the command we can execute, and implemeted the way to render it to the "textual" representation. This could be used by `Real` runner directly, but this still suffers from a different issue. We give `Real` runner to much access, by adding `MonadIO` to the context. There is a solution however. We can create a custom `Monad` which can provide all needed functions for `Real` to proceed. Going this way, we can hide how we "render" and "execute" git calls from the `Real` runner, which implies that it has no way to run arbitrary commands at all. #299
Contributor
Author
Values to `git config` should be quoted to work properly, otherwise they (specifically aliases) would be set as multi-value configs. However, if we just blindly change this to be quoted values, we would split them into separate arguments for a proc, which would lead to the same issue. To improve this, we just need to use `[]` instead of `Text` for command args. Note: I've switched to "raw strings" (`[s|raw string|]`) in `AcquireRepositorySpec.hs` to remove escaping of double quotes. #299
extsoft
approved these changes
Mar 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is an issue in how we test actions. Fundamentally, we rely on the fact that the
Realrunner is generatinggitcalls correctly. This could be neglected in theory, but there is another issue, which forces us to generate "textual" representation of what our command is doing, in multiple places, which leads to code repetition.As a solution to this, I've created 1 data type for every type of the command we can execute, and implemeted the way to render it to the "textual" representation.
This could be used by
Realrunner directly, but this still suffers from a different issue. We giveRealrunner to much access, by addingMonadIOto the context.There is a solution however. We can create a custom
Monadwhich can provide all needed functions forRealto proceed. Going this way, we can hide how we "render" and "execute" git calls from theRealrunner, which implies that it has no way to run arbitrary commands at all.Values to
git configshould be quoted to work properly, otherwise they(specifically aliases) would be set as multi-value configs.
However, if we just blindly change this to be quoted values, we would
split them into separate arguments for a proc, which would lead to the
same issue.
To improve this, we just need to use
[]instead ofTextfor commandargs.
Note: I've switched to "raw strings" (
[s|quoted "string"|]) inAcquireRepositorySpec.hsto remove escaping of double quotes.#299
The contribution:
CONTRIBUTING.md > Committing the changesrulesREADME.md > Hands-on development notes@bees-hive/elegant-git-maintainers, please review.