codeleague / codecoach Goto Github PK
View Code? Open in Web Editor NEWAutomated code review tool
Home Page: https://github.com/codeleague/codecoach
Automated code review tool
Home Page: https://github.com/codeleague/codecoach
We have command codecoach --<config1>=<value1> --<config2>=<value2>
to execute CodeCoach.
Would be nice if we also have codecoach --config=<configFilePath>
to read from.
And config file could be formatted like
repo:
url: https://github.com/codeleague/codecoach
pr: 40
token: 123qwe123qwe123qwe123
buildLogFiles:
- type: tslint
file: /path/to/log.json
cwd: /current/dir/of/lint/output
- type: msbuild
file: /path/to/output/log
cwd: /path/of/cwd
output: /path/to/codecoach/output.json
maybe ?
.codecoach
? So users can just codecoach
So we don't have to test branches on actual project
cwd
is important to codecoachAnd put them in a single review comment
master
branch to main
)master
branch to be removedFurther steps
according to https://github.com/thomaslevesque/GenerateCSharpErrors/blob/master/CSharpErrorsAndWarnings.md
there are 5 severity level:
Hidden Info Warning Error Fatal
but in LogSeverity:
Info Warning Error
so we can
$ yarn global add codecoach
and then
$ codecoach --pr=1234 --token=5678 ....
next
/ beta
/ experimental
in npmmain
branchWhy not ?
TODO: ESLint parser
in GithubProvider
L#38 in PR #5
resource location is hardcoded to 'https://github.com/`
We need this to be configurable. May be create new config called resourceBaseUrl
?
This is a work-in-progress proposal to add plugins support to CodeCoach.
This proposal may include the followings:
codecoach.config.js
)yargs
which means command line options and existing json config file will require reworkDocument should answer these following questions
some method createMessageWithEmoji
or createComment
should move out from Provider
and have own class maybe Provider.utils
log
[10:55:58]Collecting changes in 2 VCS roots (14s)
[10:59:34]The build is removed from the queue to be prepared for the start
[10:59:34]Starting the build on the agent "hk-unix-1630380965918"
[10:59:34]Updating tools for build
[10:59:34]Clearing temporary directory: /opt/buildagent/temp/buildTmp
[10:59:34]Publishing internal artifacts (3s)
[10:59:34]Checkout directory: /opt/buildagent/work/cb585e686fd79a0a
[10:59:34]Resolving artifact dependencies
[10:59:34]Step 1/2: Run (Command Line) (19s)
[10:59:34][Step 1/2] Swabra
[10:59:34][Step 1/2] Starting: /opt/buildagent/temp/agentTmp/custom_script4594896988933018394
[10:59:34][Step 1/2] in directory: /opt/buildagent/work/cb585e686fd79a0a
[10:59:34][Step 1/2] PR 420
[10:59:34][Step 1/2] MSBuild execution path C:/buildagent/work/1c22f4d3d9030336
[10:59:34][Step 1/2] ESLint execution path C:/buildagent/work/1c22f4d3d9030336
[10:59:34][Step 1/2] Unable to find image 'reg-hk.agodadev.io/library/node:14-slim' locally
[10:59:34][Step 1/2] 14-slim: Pulling from library/node
[10:59:34][Step 1/2] babf97a3f00a: Pulling fs layer
[10:59:34][Step 1/2] d81eb1809d95: Pulling fs layer
[10:59:34][Step 1/2] 1d14a5c3c182: Pulling fs layer
[10:59:34][Step 1/2] 21d157458a67: Pulling fs layer
[10:59:34][Step 1/2] b358ef6b56c5: Pulling fs layer
[10:59:34][Step 1/2] 21d157458a67: Waiting
[10:59:34][Step 1/2] b358ef6b56c5: Waiting
[10:59:34][Step 1/2] d81eb1809d95: Verifying Checksum
[10:59:34][Step 1/2] d81eb1809d95: Download complete
[10:59:35][Step 1/2] 21d157458a67: Verifying Checksum
[10:59:35][Step 1/2] 21d157458a67: Download complete
[10:59:35][Step 1/2] b358ef6b56c5: Download complete
[10:59:35][Step 1/2] babf97a3f00a: Download complete
[10:59:35][Step 1/2] 1d14a5c3c182: Verifying Checksum
[10:59:35][Step 1/2] 1d14a5c3c182: Download complete
[10:59:36][Step 1/2] babf97a3f00a: Pull complete
[10:59:36][Step 1/2] d81eb1809d95: Pull complete
[10:59:39][Step 1/2] 1d14a5c3c182: Pull complete
[10:59:39][Step 1/2] 21d157458a67: Pull complete
[10:59:39][Step 1/2] b358ef6b56c5: Pull complete
[10:59:39][Step 1/2] Digest: sha256:3f0e71eee1467ac6d0a16ea66da16e1e0092c56d7e06ebaf2695b5de175cd4d9
[10:59:39][Step 1/2] Status: Downloaded newer image for reg-hk.agodadev.io/library/node:14-slim
[10:59:53][Step 1/2] /usr/local/bin/codecoach -> /usr/local/lib/node_modules/codecoach/dist/app.js
[10:59:53][Step 1/2] + [email protected]
[10:59:53][Step 1/2] added 83 packages from 50 contributors in 13.012s
[10:59:54][Step 1/2] error: MSBuildParser Error: log structure doesn't match {"log":"C:\\buildagent\\work\\1c22f4d3d9030336\\src\\Agoda.WebSite.MVC.Api\\Agoda.WebSite.MVC.Api.csproj : warning NU1701: Package 'Microsoft.AspNet.WebApi.Client 5.2.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project."}
[10:59:54][Step 1/2] error: Unexpected error MSBuildParser Error: log structure doesn't match {"stack":"Error: MSBuildParser Error: log structure doesn't match\n at MSBuildParser.toLog (/usr/local/lib/node_modules/codecoach/dist/Parser/MSBuildParser.js:25:19)\n at /usr/local/lib/node_modules/codecoach/dist/Parser/MSBuildParser.js:17:32\n at Array.map (<anonymous>)\n at MSBuildParser.parse (/usr/local/lib/node_modules/codecoach/dist/Parser/MSBuildParser.js:17:14)\n at App.<anonymous> (/usr/local/lib/node_modules/codecoach/dist/app.js:60:31)\n at Generator.next (<anonymous>)\n at fulfilled (/usr/local/lib/node_modules/codecoach/dist/app.js:6:58)"}
[10:59:54][Step 1/2] error: Unexpected error {"error":{}}
[10:59:54][Step 1/2] Process exited with code 1
[10:59:54][Step 1/2] Process exited with code 1 (Step: Run (Command Line))
[10:59:54][Step 1/2] Step Run (Command Line) failed
[10:59:54]Step 2/2: Post check clean up (Cleanup docker data in Linux agent)
[10:59:54]Publishing internal artifacts (3s)
[10:59:54]Publishing artifacts (3s)
[10:59:58]Build finished
The C# rules is write for parse a line like this,
Broken.cs(6,8): warning AG0030: Prevent use of dynamic [C:\Users\kthuswongsa\Documents\codecoach\sample\csharp\broken.csproj]
that take Broken.cs for source and take (6,8) as a line and lineOffset,
the problem is
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [C:\Users\kthuswongsa\Documents\codecoach\sample\csharp\broken.csproj]
this error have no line and lineOffset so it have to write a new rules to parse its.
Steps:
Instead of manually copying target code in ./tmp/repo
in CI.
Make sure to run CodeCoach at source root folder and use cwd to get relative path.
const process = promisify(exec);
const git = await process(command.cmd.join(' '), { cwd: command.cwd });```
==> git.stderr has all output instead of git.stdout
The errors are the following:
--------
Error: Error: Cloning into './repo'...
at GithubProvider.<anonymous> (C:\Users\bpuangthamaw\Documents\GitHub\codecoach\src\Provider\Github.provider.ts:39:13)
at Generator.throw (<anonymous>)
at rejected (C:\Users\bpuangthamaw\Documents\GitHub\codecoach\src\Provider\Github.provider.ts:6:65)
at process._tickCallback (internal/process/next_tick.js:68:7)
APP_LOG_FILE_PATH=dotnetbuild.json
APP_WARN_FILE_PATH=dotnetbuild.wrn
APP_ERR_FILE_PATH=dotnetbuild.err
and
AGENT_ERROR_LOG_PATH=dotnetbuild.err
AGENT_WARN_LOG_PATH=dotnetbuild.wrn
AGENT_LOG_PATH=dotnetbuild.json
it duplicated settings, so AGENT should override or inherit from APP
README
CodeCoach tries to comment on the issue that occurs in the touched file but not touched line.
For example, File A
was changed in line between 10-50. CodeCoach reports one issue (issueA)
on line 15. But, there is another issue(issueB)
from dotnet build
on line 80.
CodeCoach, with its behavior, reports every issue in a touched file. So, it will try to report both issueA
and issueB
But, GitHub
does not allow us to comment on the untouched line
(where issueB
occurs). Thus, CodeCoach fails here.
From two pictures above, line: 857
is not touched in the pr. So, it can't be commented on.
For visibility and possibility of data collection.
(Can be a configurable behavior)
not only PR status check but post 'Approve', 'Comment' or 'Request Change' to the PR
Add step in publish-npm.yml flow to use release note to prepend CHANGELOG.md
In Config.ts
and .env
should remove APP_LOG_LINE_SPLITTER
and the system should detect it automatically
Since all CI systems already pulling source before executing anything.
If answer is no then we can remove Git.ts
and --noClone
flag.
less code!
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.