Comments (25)
So! Let me rephrase in my own words.
If I understand, you want the pipeline to be attached when run through git-hooks.
So that, whenever something unexpected happens on a git push
for example:
- You can see the displayed logs.
- The git operation is halted.
I like pipelines detached by default, because long running jobs can run without stopping or halting git commands.
But if this behavior is to unconventional and harm the users software quality, i will change asap default to attached.
I came to an option,
that could circumvent the issue.
A global and a per pipeline flag to override the default behavior.
const config: Config = {
pipelines: [{
steps:[],
attach: true
}],
attach: true
};
In the case where attached becomes the default behavior:
const config: Config = {
pipelines: [{
steps:[],
detach: true
}],
detach: true
};
from pipelight.
The last option really looks good only if you also add the log settings.
I suggest some kind of option:
// Yes, java bit me
type additionOfConfigOrPipelines = {
// true - attach, false - detach,failure - when an error occurs
attach: boolean|"failure"
// -v = 1,-vv = 2,-vvv=3,-vvvv=4
logLevel: 1|2|3|4
}
If it is possible to do this, I will be very grateful and it will solve a lot of problems.
from pipelight.
Nice! Let's do it!
I'll need some time!
I'll come back in 24h with something!
from pipelight.
I came to something that should satisfy us both...
The behavior on the command line for the run
subcommand remains unchanged:
# run a pipeline in detached mode
pipeline run <pipeline_name>
# run a pipeline in attached mode
pipeline run <pipeline_name> --attach
The command executed by every git hooks is pipelight trigger
.
Therefore the behavior of the trigger
subcommand is the one that has evolved:
Now git hooks are by default attached:
# run pipelines in attached mode
pipeline trigger --attach
- For heavy workloads that should run in the background, one needs to specify.
pipelines: [
{
name: "run_in_bg"
options: {
attach: false // or detach: true?
}
}
]
- Pipelight logs are printed to stdout on git action (whether it succeeds or not)
To change default pipeline log level(error) use the following option:
pipelines: [
{
name: "run_in_bg"
options: {
log_level: "error" | "warn" | "info" | "debug" | "trace"
}
}
]
Does it suits your needs ?
Maybe I shouldn't keep those names for the log levels as they does not make much sense for the tree view, but I prefer it to numbers.
What sounds more logic to you between the use of detach: true
or attach: false
to override the default attached behavior ?
from pipelight.
Thank you very much, I hope this will improve the product and make it even more attractive.
Yes, if it is possible to define behavior for all pipelines at the same time, then it will be even better.
I donβt know about others, but it seems logical to me to use attach: false
and not add another option in the configuration.
from pipelight.
This is the fastest support I've seen so far!
After looking at the code, I may have missed it, but will it be possible to change logLevel globally?
from pipelight.
I am on it!
from pipelight.
Thanks for your help and implementation
from pipelight.
I checked and so far neither global config nor local pipelines options are working
const config: Config = {
pipelines: [
lint,
],
options: {
attach: true,
log_level: "info",
},
}
Here is my configuration, and the task executes, but does not display in the terminal.
WIth git-hooks, after fixing the typo, everything works fine
from pipelight.
If there is such a possibility, then it would not be bad for run to have such settings.
I understand that it is possible to enter a long command each time.
But when working, it is more convenient to run it briefly and watch the output.
Use this tool like task runner.
from pipelight.
Ah yes!
For the "info" log level, pipelight prints stdout on succes and stderr on fail.
Linters tend to avoid standards and print to both outputs.
I recommand setting the log level to "trace" to display stdout and stderr when linters are involved.
from pipelight.
Yes, I checked everything, it really works great.
Thank you very much again for such a prompt solution to the problem.
from pipelight.
It's here for you to test! On the feature/detach_flag branch!
I will merge it tomorow to the dev branch / then to master once it's polished and that the doc is updated.
It shouldn't take more than a day.
Thank you for your kind support!
I hope you'll appreciate the software even more!! π
from pipelight.
Just merged the feature into master and updated the documentation:
version tag is v0.7.13
I indeed added the global properties.
Don't forget to regenerate your git-hooks π .
pipelight enable git-hooks
from pipelight.
Indeed there's a bug in log levels.
Which command doesn't work as expected?
- pipelight run
- or pipelight trigger when using git commands
from pipelight.
Settings don't work in both version.
That is, they do not affect anything.
from pipelight.
I pushed the v0.7.14 to master! This should do the trick! π
The global settings were not retrieved properly.
from pipelight.
The settings do now work for git-hooks, but still do not work for the run command.
And, unfortunately, big output is not displayed.
from pipelight.
Ah! I am relieved it finally works!
This was intended to be as is:
I chose that pipelight run
will not be overridden by those settings because they can be set on the command line.
only pipelight trigger
is impacted because it is a mess to dig inside the git hook and modify it manually.
For the big output...
Does it displays at least something like the pipeline header?
β Succeeded - Fri, 1 Dec 2023 10:59:43 +0100
branch: master
action: pre-push
commit: 2efb5d211f575d651d0adc0cb5c5923fdfb5c244
pipeline: test_options (2s15ms)
or just nothing ?
maybe you'd want to set the log level to trace?
Ensure the global level is not overridden by the pipeline property.
from pipelight.
Ok! I'll modify the run
command behavior
from pipelight.
For large ouptut, everything is displayed except the output itself.
from pipelight.
So! I don't know if this is easy for you to try it, but I made the changes available into the dev branch!
The configuration settings now inpact the pipelight run
command! and the arguments of the command line can overridde these settings.
As I may not have the time needed for deeper code review today, the changes will only be merged to master tomorrow.
from pipelight.
Thank you for quickly introducing new features.
LogLevel doesn't work yet, but attach
is ok.
from pipelight.
I needed to better understand the clap.rs crate. All done and pushed to master under v0.7.15
from pipelight.
Fiiine! I am looking forward to read you for other improvement suggestions!!
from pipelight.
Related Issues (11)
- discord link no more working HOT 1
- make video to showcase pipelight functionning in a terminal HOT 3
- Add Homebrew formula HOT 23
- Small doc fix HOT 1
- More information about watcher HOT 8
- global and local options or not interpreted when using toml and yaml HOT 2
- Remove comments from init templates
- Expired certificate on pipelight.dev HOT 1
- Feature: Live View HOT 3
- DAX prompt is not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pipelight.