murex / tcr Goto Github PK
View Code? Open in Web Editor NEWTCR (Test && Commit || Revert) utility
License: MIT License
TCR (Test && Commit || Revert) utility
License: MIT License
Is your feature request related to a problem? Please describe.
Show desktop notification on the following events, in addition to terminal traces:
Describe the solution you'd like
Re-use desktop notification mechanisms already used for timer notifications
Describe alternatives you've considered
N/A
Additional context
N/A
Now that TCR does git commits bypassing GPG signing, it can work too for people who have set up GPG signing (cf. #15 ).
We should add a warning somewhere to indicate that TCR does unsigned commits
Add a warning in TCR README.md
N/A
N/A
Toolchain "cmake-local" was added in release v0.9.0 as a temporary solution until our C++ katas have their own local cmake toolchain embedded.
Now that this is done, there is no longer the need to keep "cmake-local" as a TCR built-in toolchain.
Leave it as a TCR built-in toolchain. But as it's very specific to our katas setup, this toolchain would be useless for anyone not having cmake installed locally with very specific paths.
Write your answer here.
Is your feature request related to a problem? Please describe.
Some users have set up their git configuration so that it asks for GPG passphrase on every commit.
This makes TCR unusable as it's not set up to take input for passphrase every time it runs a commit. Besides, even if it did, that would make a bad user experience due to the potentially high number of commits triggered by TCR.
Describe the solution you'd like
Make sure TCR bypasses the GPG passphrase request when it runs a git commit: git -c commit.gpgsign=false commit
Describe alternatives you've considered
Another solution is to add in the TCR guidelines a remainder to turn off GPG passphrase request on every git commit: git config commit.gpgsign false
This alternate solution is less preferable as it's not transparent from user point of view and forces them to change their git settings for running TCR. Besides signing every TCR commit seems to be an overkill option
Additional context
N/A
Add the possibility to put TCR driver mode on hold. This should have a behavior similar to pressing a pause
button.
While in driver mode, add a keyboard shortcut allowing to put all TCR driver operations, for instance:
For TCR shortcuts, proposal is to use the following:
H
for putting on holdR
for resuming operationsCurrently, the only alternative is to exit driver mode through pressing Q
, and then re-entering driver mode through pressing D
. The main limitation with this alternative is that the timer restarts from 0.
N/A
Add bazel as a built-in toolchain.
Bazel potentially can work with any language on the 3 platforms macOS/Linux/Windows. This makes it a natural candidate for being defined as a built-in toolchain.
N/A
N/A
We sometimes need to synchronize repository contents (files other than watched source or test files).
Having shortcuts allowing to do this without leaving TCR could be handy.
N/A
N/A
TCR is currently built with Go 1.18, while version 1.19 has been here for several months already, and version 1.20 has been announced.
Upgrade go version in tcr module from 1.18 to 1.19.
We need to carefully test that there is no regression on TCR, especially related to the changes introduced in version 1.19 to PATH lookups (cf. section "PATH lookups" in Go 1.19 release notes).
We should check in particular that:
Stick with Go 1.18.
Write your answer here.
When running tcr in solo mode, TCR crashes trying to launch the periodic reminder.
The problem exists on the following releases:
Steps to reproduce the behavior:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x9a1b0e]goroutine 51 [running]:
github.com/murex/tcr/tcr-engine/timer.(*PeriodicReminder).Start(0x0)
/home/runner/work/TCR/TCR/tcr-engine/timer/periodic_reminder.go:105 +0x2e
github.com/murex/tcr/tcr-engine/engine.(*TcrEngine).RunAsDriver.func1()
/home/runner/work/TCR/TCR/tcr-engine/engine/tcr.go:192 +0xb6
github.com/murex/tcr/tcr-engine/engine.(*TcrEngine).fromBirthTillDeath.func1()
/home/runner/work/TCR/TCR/tcr-engine/engine/tcr.go:260 +0x38
gopkg.in/tomb%2ev2.(*Tomb).run(0xc0001ec0f0, 0x0)
/home/runner/go/pkg/mod/gopkg.in/[email protected]/tomb.go:163 +0x36
created by gopkg.in/tomb%2ev2.(*Tomb).Go
/home/runner/go/pkg/mod/gopkg.in/[email protected]/tomb.go:159 +0xf3
TCR should not launch any timer when running in solo mode
OS: any
Versions
Additional information
Currently, tcr command does not handle CTRL-C
(SIGINT), e.g. it lets the underlying OS interrupt it without interfering.
This is sometimes problematic, due to the fact that TCR turns off terminal echo when it's waiting for the user to press a shortcut. The consequence when this happens is that the user has the feeling that the terminal is in a frozen state.
There is a workaround to this problem (typing stty echo
+ ENTER
), but it would be better if TCR could enforce that the terminal echo is back on before SIGINT-triggered termination.
Add a routine on SIGINT detection that calls stty echo before exiting.
Cf. workaround described in Feature Description
section.
N/A
Currently, TCR uses the base directory parameter for 2 different purposes:
In some situations, we need to be able to launch build and test commands from a directory that is different from the base directory used for searching source and test files
Proposal is to use the directory from which tcr command is executed as the working directory:
With this approach users who want to have separate working and base directory can do the following:
cd <working-directory-path>
<path-to-tcr-exe>/tcr --base-dir <base-directory-path>
User who want to use the existing behavior can do it as follows:
cd <base-directory-path>
<path-to-tcr-exe>/tcr
We could also add a new parameter --work-dir for even more flexibility
N/A
Is your feature request related to a problem? Please describe.
Current implementation systematically creates new commits with the "TCR" commit message. It would be nice for the user
to customize these commit messages.
Describe the solution you'd like
Use a configuration value with the chosen message (always the same message, maybe with some special fields such as date, time, user)
Describe alternatives you've considered
It would be even better to have more meaningful messages on the "why" of the commit. But this requires for TCR to have an understanding on what happens on every commit, which is not trivial.
Additional context
N/A
Add the possibility to browse TCR stats based on git commit history
Add a new "stats" subcommand to TCR.
When running tcr stats
, TCR will:
Stats that will be printed:
N/A
N/A
So that Python developers can use TCR
N/A
N/A
Is your feature request related to a problem? Please describe.
Possibility to add a custom toolchain. This would allow any user to tune TCR to their own context
Describe the solution you'd like
Use of configuration files (yaml), 1 per toolchain
Describe alternatives you've considered
Add built-in toolchains, just as we currently do with gradle, maven and cmake. This is more robust as it comes built-in in the tool. The drawback is that it's not very flexible. Besides, adding a new toolchain in the tool means releasing a new version of TCR.
Additional context
N/A
Refactor TCR menu shortcuts handling in a more structured way.
This issue comes from Parking Lot in [#142]
Note This is a refactoring ticket. TCR behavior should remain unchanged
TODO
Leave the code as it is
Write your answer here.
This feature is a prerequisite to [#33]. Its purpose it to generate the data that will be used later on to compute TCR metrics.
With this feature, TCR is logging into ${config_dir}/.tcr/event-log.csv
the following events:
The information that is logged with each event is the following:
Information is logged in CSV format so that it can easily be imported into an excel spreadsheet for further computation and analysis.
N/A
N/A
When adding new features to TCR, it's a bit cumbersome to test the new tool manually. We usually resort to running TCR from the exemples, with a custom command line.
Wrap the custom command line in a script.
It would also be nice to be able to easily debug this latest-built tool seamlessly from the IDE.
No response
make run
targetCurrently, TCR's cpp built-in language is set to recognize the following file extensions as C++ source files:
.c
- .h
.cc
- .hh
.cpp
- .hpp
Some projects actually use .cxx
and .hxx
as C++ file extensions. In order to make cpp language settings more inclusive, we should add them to the list of recognized file extensions
Extend cpp language pattern filters to include .cxx
and .hxx
as valid source file extensions
N/A
N/A
So that C# developers can use TCR out of the box
Either a built-in solution or through configuration files
Every C# user will have to write their own configuration
Cf. https://github.com/Tr00d/Kata-BowlingGame to use as a starting point for setting up TCR C# configuration
TCR can be slow to run on the whole TCR codebase.
Configure TCR to use go test -short
when running tests on the whole TCR codebase
Skip slowest tests in short mode.
This action came out of the Retro we did on 2023-01-24
When running with commit-on-fail + git auto-push options, fail and revert commits are not pushed right away.
The push only happens after a passing-test commit
Steps to reproduce the behavior:
The 2 commits should be pushed to origin right after the second commit operation
Additional information
Some teams use Perforce instead of Git as their official VCS.
We need to support using Perforce for them to be able to use TCR on their production code.
TCR can do all the VCS operations with Perforce instead of Git.
No response
stubbed
stubbed
stubbed
stubbed
stubbed
discarded
discarded
tcr check
so that it's able to check either git or p4 environment (or both?) depending on workspace stubbed
env P4CLIENT=xxx p4 status
(rc = 0 when cwd is in xxx workspace, rc=1 otherwise)Is your feature request related to a problem? Please describe.
Possibility to add a custom language. This would allow any user to tune TCR to their own context
Describe the solution you'd like
Use of configuration files (yaml), 1 per language
Describe alternatives you've considered
Add built-in languages, just as we currently do with java and C++. This is more robust as it comes built-in in the tool. The drawback is that it's not very flexible. Besides, adding a new language in the tool means releasing a new version of TCR.
Additional context
N/A
Move built-in languages and toolchains into an embedded filesystem in replacement for having them hard-coded in Go.
Note: this change should not have any impact on TCR's existing behavior related to languages and toolchains management and customization.
Currently, configuration for TCR built-in languages and toolchains is configured directly into go code (in packages tcr-engine/language and tcr-engine/toolchain).
The idea would be to move these hard-coded configurations into yaml files that have the same structure and contents as the configurations files generated through tcr config save
command.
These files would then be embedded into TCR binaries at build time leveraging on Go's embedded filesystem feature.
Leave the code as it is and continue to use Go files to describe built-in languages and toolchains configuration
N/A
Now that TCR is providing summary stats out of git commit history, it would be nice to also be able to browse detailed stats reports
Generate charts out of TCR stats in HTML/JS format and open them in local navigator.
A more advanced (and likely more expensive) solution could be have TCR instance run its own HTTP server to provide more advanced navigation in the stats report, and allow access from remote navigators.
N/A
When using TCR with Go language and either go-tools
or gotestsum
toolchains, when there is a build error in a test file while all production files can be built, this error is detected during TCR test phase instead of during TCR build phase. This triggers a revert operation, while it should simply abort the TCR cycle due to build failure.
Steps to reproduce the behavior:
When build-breaking changes are introduced in either production or test files, TCR should abort the TCR cycle after the build phase and not run the tests nor revert anything.
The issue is a due to a discrepancy between Go tools build/test commands, and TCR build/test phases:
go build
builds only production files, ignoring *_test.go
filesgo test
builds test files and runs the testsCurrently, TCR built-in toolchains for go do the following:
go build ./...
go tests ./...
(or gotestsum ./...
)In order to fix this discrepancy, TCR's build command in all Go toolchains should be updated to go test -count=0 ./...
. This command allows to build both production and test files without running the tests, which is what we expect in TCR build phase.
Now that the number of language / toolchains supported by TCR is increasing, and to make it more straightforward for people to understand how to tune and use it in their context, it would be nice to have an examples directory with one entry for each language/toolchain pair.
Add the following directory structure at the root of the repository:
Each subfolder should contain a short README.md explaining how to run TCR with this example, along with pre-requisites.
N/A
N/A
running make is by construction language-agnostic, as it depends on what is configured in the Makefiles provided with the project.
Thus having a make built-in toolchain should be quite convenient for adding new languages.
Add make built-in toolchain, with 2 targets:
This toolchain could be compatible with any language
N/A
N/A
Is your feature request related to a problem? Please describe.
Current toolchains defined in TCR are Murex-biased, e.g. they are tuned to run with our kata structure:
These are constraints for who wants to use TCR in their own context.
The idea would be to split each of these toolchains into the following ones:
Describe the solution you'd like
Probably better to have them as built-in in TCR
Describe alternatives you've considered
Rely on toolchain configuration files
Additional context
N/A
Is your feature request related to a problem? Please describe.
So that Kotlin developers can use TCR
Describe the solution you'd like
Either a built-in solution or through configuration files
Describe alternatives you've considered
N/A
Additional context
N/A
When using TCR with Java language and either gradle or gradle-wrapper toolchains, when there is a build error in a test file while all production files can be built, this error is detected during TCR test phase instead of during TCR build phase. This triggers a revert operation, while it should simply abort the TCR cycle due to build failure.
Steps to reproduce the behavior:
Open a Java project and start TCR with Gradle or Gradle Wrapper toolchain
Make sure the project passes build and test
Introduce a non breaking change in a production file (for example by adding a comment)
Introduce a build-breaking change in a test file
Save the changes to trigger a TCR cycle
You should observe that build passes, but that tests fail
The breaking changes in the test file are not reverted (which is expected), while the non-breaking changes in the production file are reverted (which is unexpected)
When build-breaking changes are introduced in either production or test files, TCR should abort the TCR cycle after the build phase and not run the tests nor revert anything.
All TCR versions until v0.19.1
All platforms
The issue is a due to a misunderstanding of the gradle build -x test
option: this option forces gradle build
to skip running the tests, but it actually also skips building them.
We should replace it with gradle build testClasses -x test
which enforces building the tests while skipping their execution.
No response
We are facing some issues with maintaining the GUI application
We want to remove all the code related to the TCR-GUI application from the repository.
To achieve that, we need to do the following:
In addition to that, we want to merge the tcr-cli and tcr-engine modules.
N/A
It would be handy that TCR provides some stats on how it was used.
We need to experiment to understand which stats are the more helpful. Here are some examples of stats that we could provide:
We first need to be able to log TCR event history. We will likely need to make the logs persistent if we want to provide stats over time. This will be required also in cases where the user exits and restarts TCR.
List of events that we shall log:
If we want to provide mob related stats, we shall also log:
We also need to clarify how the user shall access these stats:
tcr stats
s
that would display current statsN/A
N/A
On some Windows machines, keyboard shortcuts are not properly handled when running TCR from Intellij Idea embedded terminal using Git Bash.
This seems to be related to some Windows environment settings, as we could not reproduce the problem on another machine using the same Intellij version. It's unclear which settings trigger the different behaviors.
On the machine where the problem was observed:
Steps to reproduce the behavior:
?
-> the ?
character is displayed, but nothing else happens (expected behavior is that the ?
character is not displayed, while the list of available options is displayed)ENTER
-> the list of available options is displayed[TCR] Starting TCR version v0.11.0...
(...)
[TCR] -------------------------------------------------------------------------
[TCR] What shall we do?
[TCR] D -> Driver role
[TCR] N -> Navigator role
[TCR] P -> Turn on/off git auto-push
[TCR] Q -> Quit
[TCR] ? -> List available options
?
[TCR] -------------------------------------------------------------------------
[TCR] Available Options:
[TCR] D -> Driver role
[TCR] N -> Navigator role
[TCR] P -> Turn on/off git auto-push
[TCR] Q -> Quit
[TCR] ? -> List available options
'TCR] No action is mapped to shortcut '
ENTER
keyAfter investigation, it appears that this is related to the windows console stdin mode.
Cf. https://docs.microsoft.com/en-us/windows/console/setconsolemode
In order to have the expected behavior, we need to enforce that the 2 following flags are always disabled on stdin:
Good news is that fixing this allows to run TCR from Windows Power Shell
Sometimes, when running tcr stats
, the trace report is incomplete, e.g. last lines of the report are not displayed, although tcr application exits without error nor crashing.
So far this unexpected behavior has only been reproduced when running tcr from Goland/IntelliJ embedded git bash terminal on Windows. The problem does not seem to happen when running tcr from a standalone git bash terminal.
Steps to reproduce the behavior:
./tcrw stats
[TCR] That's All Folks!
)Expected output when running tcr stats
should look like the following:
[TCR] Starting TCR version 0.19.0...
[TCR] -------------------------------------------------------------------------
[TCR] Running in stats mode
[TCR] Base directory is xxx
[TCR] - Branch: xxx
[TCR] - First commit: Thursday 29 Sep 2022 at 13:07:52
[TCR] - Last commit: Thursday 29 Sep 2022 at 15:19:39
[TCR] - Number of commits: 67
[TCR] - Passing commits: 46 (69%)
[TCR] - Failing commits: 21 (31%)
[TCR] - Time span: 2h11m47s
[TCR] - Time in green: 1h38m13s (75%)
[TCR] - Time in red: 33m34s (25%)
[TCR] - Time between commits: 11s (min) / 1m59s (avg) / 16m46s (max)
[TCR] - Changes per commit (src): 0 (min) / 3.1 (avg) / 19 (max)
[TCR] - Changes per commit (test): 0 (min) / 2 (avg) / 16 (max)
[TCR] - Passing tests count: 0 --> 11
[TCR] - Failing tests count: 0 --> 0
[TCR] - Skipped tests count: 0 --> 1
[TCR] - Test execution duration: 0s --> 0s
[TCR] That's All Folks!
N/A
Add the possibility to retrieve easily the git commit history.
Add a subcommand tcr log
that allows to print TCR commit history similarly to what git log
does.
tcr log
will print out only TCR commitsRun git log by hand and filter out the results
N/A
Having the possibility to run one single TCR cycle without waiting for filesystem changes, and exit right away could be quite handy as it could allow among other things:
Add a new tcr-cli run-mode (in addition to mob and solo).
This new run-mode should:
RC | Meaning |
---|---|
0 | Build and Test Passed and changes were committed with no error |
1 | Build failed |
2 | Build passed, one or more test failed, and changes were reverted |
3 | Error in configuration or parameters |
4 | Git error |
5 | Any other error |
N/A
In addition, we could add a shortcut to tcr-cli mob and tcr-gui allowing to trigger execution of a single TCR cycle
When using TCR in a mob, it would be nice that everyone in the mob could access the same session information (timer, stats, driver execution trace, etc.)
We could use a serverless solution in order to make this work
N/A
Is your feature request related to a problem? Please describe.
This would be nice so that we can apply TCR to itself (eat your own dog food).
Describe the solution you'd like
Either built-in solution, or through a configuration file.
Describe alternatives you've considered
N/A
Additional context
N/A
TCR has a feature (currently disabled) reminding participants when they didn't save any work for some time.
We could leverage on this feature to regularly display quotes from experts in these reminder messages
Build an "expert quotes" provider service and randomly pull a quote from it every time we send a reminder message.
N/A
We need to try it to make sure it can catch users' attention. Previous tests with the reminder (without expert quotes) showed that users were not really paying attention to them, which is why we disabled it.
TCR currently uses origin
git remote when processing git push/pull operations. Although it works in majority of cases as origin
is created automatically when cloning a repository, there can be situations where it fails:
origin
to something elseorigin
Add a new CLI parameter / configuration setting allowing to specify the name of the git remote.
If this setting is not specified, TCR will use origin
as the default value
origin
properly set in order to run TCRtcr check
N/A
Originally posted by Tr00d June 27, 2022
Hi,
First of all, thanks for building the tool, I'm a big fan and I mostly used the Shell one until recently. I picked up the Go version from version 13.0 with C# support.
It's now a tool I use in most workshops and katas ๐
While trying to demo the tool for someone, I realized I was not able to use it on an empty repository. I didn't find anything in the configuration.
Did I miss something, or is it possible at all?
Repro steps:
git init
./tcr.exe -l csharp check
Here's what I have in the logs:
[TCR] โค checking git environment
[TCR] โ git command path is C:\Program Files\Git\cmd\git.exe
[TCR] โ git version is 2.36.0.windows.1
[TCR] โ git username is Guillaume Faas
[TCR] โผ git remote origin is not set
Thanks a lot and keep up the good work!
When running TCR with a language parameter value that does not match any of the built-in languages not any of the custom languages defined through configuration files, TCR crashes with the following trace:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0xa0 pc=0x7aaa41]goroutine 1 [running]:
github.com/murex/tcr/tcr-engine/language.(*Language).setBaseDir(...)
.../tcr/tcr-engine/language/language.go:316
Steps to reproduce the behavior:
I expected TCR to exit with a message saying that language "xxx" is not supported
Cause of the error:
call to language.(*Language).setBaseDir(...) on a nil language instance pointer
Fix:
call setBaseDir(...) only when language instance pointer is not nil
With the number of options for TCR configuration and customization increasing (especially since the introduction of custom languages and toolchains), having a TCR subcommand allowing to quickly check that everything is set up properly could prove quite handy.
The idea would be to go through all settings, configuration values and command line parameters and tell the user if everything looks consistent, without actually running the TCR engine.
Add a subcommand tcr check
that would do the following:
Return code for this command should be 0 if everything is ok, 1 if there are warnings, 2 if there are errors
Current alternative is to run tcr one-shot
.
The main drawback with this alternative is that it can potentially perform an actual git commit or revert, while the proposed tcr check
subcommand would not do any change to the repository.
Another potential drawback with using tcr one-shot
is when the toolchain's build and/or test command take some time to run.
N/A
Now that TCR provides the capability to add a new toolchain or a new language, we need to provide some explanations on how to do it
Add a new section in README.md describing how to proceed
N/A
N/A
After exiting "tcr solo", the terminal from which TCR was launched does not echo characters entered on the keyboard, giving the impression that the terminal shell is dead.
Steps to reproduce the behavior:
tcr solo
to launch TCR in solo modeq
to exit TCRTCR should not alter the terminal state when exiting normally
When facing the problem, the terminal state can be restored through typing stty echo
+ ENTER
(the terminal's shell actually captures what is typed on the keyboard even if it's not echoed on screen)
Make sure that all information required for starting to contribute to TCR development is available.
Add the following information in dev-doc/build.md
test_helper
which is used when running TCR tests.N/A
N/A
Is your feature request related to a problem? Please describe.
In current implementation, the trace messages on test failure always indicate that we are reverting changes. This is actually
not true when only test files have changes, as TCR is not reverting the tests, but only production code.
Describe the solution you'd like
Have a trace message clearly stating that the tests have failed but that nothing was reverted
Describe alternatives you've considered
N/A
Additional context
N/A
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.