Skip to content

Commit

Permalink
3.0.0 Typescript version merged. (#330)
Browse files Browse the repository at this point in the history
* Nodejs 16

* rmdirSync error fixed

* prettier

* pull_request.yml improved

* Typescript/main (#262)

* project scaffolding

* .gitignore

* report.yml flow adapted to typescript/main

* logger services implemented

* eslint

* jest

* Add DI library (#265)

* project scaffolding

* .gitignore

* report.yml flow adapted to typescript/main

* logger services implemented

* eslint

* jest

* Add DI library

* logger service tests (#266)

* project scaffolding

* .gitignore

* report.yml flow adapted to typescript/main

* logger services implemented

* eslint

* jest

* Add DI library

* implement loggerservice tests

* test:report script (#267)

* package-lock.json updated

* logger service refactored (#268)

* added jest as dev dependency which is needed by ts-jest (#269)

* solve "-Dsonar.projectName" from report file

* sonar report fixes

* pull_request.yml added npm install and npm run test:report. nodejs 12.x version removed

* added husky (#273)

* Arguments (#270)

* added cli argument parser for build and tool actions

* added cli parser test cases

* Add DI library (#265)

* project scaffolding

* .gitignore

* report.yml flow adapted to typescript/main

* logger services implemented

* eslint

* jest

* Add DI library

* logger service tests (#266)

* project scaffolding

* .gitignore

* report.yml flow adapted to typescript/main

* logger services implemented

* eslint

* jest

* Add DI library

* implement loggerservice tests

* test:report script (#267)

* package-lock.json updated

* logger service refactored (#268)

* added jest as dev dependency which is needed by ts-jest (#269)

* updated package.json

* added action.yml

* added documentation

* Create pull_request.yml

* 12.x removed from pull_request.yml

* implemented requested changes

* increased test coverage

* Update action.yml

Co-authored-by: Enrique Mingorance Cano <ginxaco@gmail.com>

* changed command option naming for token, cct and command. Fixed linting errors

Co-authored-by: Enrique Mingorance Cano <emingora@redhat.com>
Co-authored-by: Enrique Mingorance Cano <ginxaco@gmail.com>
Co-authored-by: Github <noreply@github.com>

* Git service (#274)

* implemented and tested git actions which don't use ocktokit

* added octokit git functions, test cases and created git mock env

* git config changes for test setup

* fix ci arror

* added test cases for octokit factory

* refactored and implemented github-api service

* Executor Service (#272)

* project scaffolding

* .gitignore

* report.yml flow adapted to typescript/main

* logger services implemented

* eslint

* jest

* Add DI library

* implement loggerservice tests

* implement command-executor

* logger service refactored

* export-command-executor.test.ts and export-command-executor.ts

* treatment

* command-builder.test.ts and implementation adapted

* command-treatment-delegator.test.ts

* maven-command-treatment.test.ts

* regex-command-treatment.test.ts

* improving coverage

* execute-command-service.ts basic stuff

* configuration-service implemented and covered

* test-logger-service.ts empty implementation

* test-logger-service.ts empty implementation

* command-executor-delegator.test.ts

* execute-command-service.test.ts

* execute-command-service.test.ts expectedCalls contract improved

* injection from constructors

* hrtime to util/date

* added types for build-chain-configuration-reader (#275)

* Typescript/system requirements (#276)

* About Commands to Execute (#257)

* system requirements section

* Inputs (#278)

* refactored arguments. restructed argument folder to contain cli folder. created a common input parser class

* refactored BuildActionType enum to FlowType and set logger level when debug flag is passed

* updated test to check for logger level

* renamed arguments/main-command-factory to arguments/cli

* added action input parser

* added documentation

* changed ParsedInputs to InputService, refactored test cases

* update logger level for debug option in the cli parser instead of input service

* added skip project execution and checkout (#279)

* Config service (#281)

* added configuration service

* added test cases for action configuration and fixed bugs for action configuration

* added cli congfiguration tests. Bug fixes in cli configuration. Refactored action configuration test

* added util tests

* added more test for cli and action config. Removed unnecessary code from base config

* added some test cases for configuration service

* refactored types for definition file

* load definition file in configuration

* refactored build-config-reader types and definition file loader in config service

* added more test cases for config service and added getTreatmentOption method

* fixed treatment options and custom command treatment option

* added parser to convert project nodes from build-config-reader to node domain object

* removed old config service

* added input validation

* bug fix in test setup

* added documentation

* updated with requested changes

* Code smells (#283)

* remove redundant await

* extracted nested ternary operations into independent statements

* remove nested string literals

* prefix unused function parameters with underscore

* remove mocks for coverage

* fix empty expect in logger test

* linted domain files

* linted arguments service

* linted config service

* linted git service

* linted input service

* linted types

* linted utils

* linted tests

* updated gitignore

* linted config.json

* added config initialization in runner (#282)

* added config initialization in runner

* bug fixes, shifted reflect-metadata import to individual runners since those are the actual entry point

* added test cases

* Update action-configuration.ts (#285)

* Checkout service (#286)

* added placeholder parser for definition file url

* added mapping to parsed node

* added definition file test cases to cli config

* updated config and input domain object

* added get source, target project in config service. update load git event and project config to consider case for branch flow

* added more test cases and updated old ones for config objects and services

* added clone to node object, added get source and target project to config service, validate start project

* added get flow type to config services

* clean up in loading git config

* changed hasPullRequest method

* added more functionality to config service to help with checkout service

* update eslint to ignore variables that begin with underscore

* implemented checkout service

* added test cases for checkout service

* updated package.json and lock file

* removed code smells

* added repository clone location to checkout info

* clean up of test data

* removed code duplication (#293)

* refactored checkout service and updated a test case (#292)

* Pre and post functionality  (#297)

* added pre and post services

* added test cases for  pre and post services

* updated test cases

* added test cases for getPre and getPost

* Archive service (#289)

* added placeholder parser for definition file url

* added mapping to parsed node

* added definition file test cases to cli config

* updated config and input domain object

* added get source, target project in config service. update load git event and project config to consider case for branch flow

* added more test cases and updated old ones for config objects and services

* added clone to node object, added get source and target project to config service, validate start project

* added get flow type to config services

* clean up in loading git config

* changed hasPullRequest method

* added more functionality to config service to help with checkout service

* update eslint to ignore variables that begin with underscore

* implemented checkout service

* added test cases for checkout service

* updated package.json and lock file

* removed code smells

* added repository clone location to checkout info

* clean up of test data

* added artifacts service

* refactored and added artifacts service

* added test cases for artifacts and upload service

* logged artifact upload results

* added requested change

* changed execute node chain argument from node to ExecutionNode (#300)

* changed execute node chain argument from node to ExecutionNode

* changed for loop for execute service

* changed node.map for execute service tests

* Prep flow (#298)

* added nodechain generator and its test cases. removed load definition file and generate place holders from base config

* added node field to checkedout node info. updated checkout service to use nodechain directly from config service

* renamed nodechain generator to definition file reader. added get definition file

* added test cases for get definition file

* refactored checkoutDefinitionTreeParallel

* Executor refactor (#304)

* changed excute result domain object to include no optional fields

* made get node command public, so that it can be used in printing execution plan. made changes as required by the changed execute result domain object

* updated test cases for executor service

* updated test cases according to the changed domain objects for executor service

* Artifact node chain (#305)

* changed artifact service to use node chain directly from config service

* updated test cases

* refactored artifact service

* updated test cases

* refactored getNodesToArchive

* Flow service (#306)

* added string representation of ExecutionResult

* added flow service

* added tests for flow service

* added FlowResult domain object

* lint fix

* bug fix while constructing NodeExecution array from CheckedOutInfo during a parallel checkout

* refactored flow

* more refactoring

* Job summary service (#307)

* pre-post services return their execution result

* added getEventUrl and getDefinitionFileUrl and updated test cases

* added job summary service

* added test cases for job summary

* fix in config service test cases

* added requested changes

* eslint: arrow-parens rule (#310)

* Runner setup (#312)

* added default flow result

* implemented runners and shifted execution to separate entry point file

* added test cases for runners

* updated package-lock.json

* updated package-lock.json

* resolve 14.x runner error

* added printing of execution failure

* configuration-reader to 3.0.0 (#318)

* @kie/build-chain-configuration-reader 3.0.4 (#321)

* updated domain objects to use Node from build-chain-config-reader

* updated artifact service to use domain objects directly from build-chain-config. passing project name as default artifact name

* updated test cases for artifact service

* updated checkout service to use domain objects directly from build-chain-config-reader

* updated command executor service to use domain objects directly from build-chain-config-reader

* updated configuration service to use domain objects directly from build-chain-config-reader

* removed code from definition file reader service which is now directly implemented by the build-chain-config-reader lib

* updated definition file reader tests

* updated tests to use domain objects directly from build-chain-config-reader

* removed custom types

* bumped up version of build-chain-config-reader to 3.0.4

* migrated mock-github poc to the actual mock-github (#322)

* e2e (#324)

* fixed action.yml

* updated .gitignore

* added scripts to build package, run e2e tests and updated dependencies

* made action argument a service and executed it in the action runner to parse input

* fixed bug in getting nodes to checkout and added artifact name validator

* improved logging in checkout service

* changed logging from info to debugging for regex-command-treatment

* getCloneUrl returns a path to the local repository when running e2e tests

* fixed bug in git version and clone

* improved error msg in getForkName

* configure octokit to use proxy if defined

* improved logging and annotations during flow execution

* improved logging for pre and post

* updated test cases

* added e2e tests for single pr flow

* fixed clone case

* added helper to enable disable easy logging

* added cross-pr tests

* updated dependencies file and single pr tests

* allow unrelated history merge

* updated gitignore and package.json

* added full downstream tests

* updated other e2e tests with comments and simplifications

* trimmed white spaces from additional-flag input

* added branch e2e tests

* added e2e pr checks

* increase test timeout limit

Co-authored-by: Github <noreply@github.com>

* Logger (#326)

* refactored logger to be a typedi service

* updated logger service for runners

* updated logger service for artifacts service

* updated logger service for checkout service

* updated logger service for command service

* updated logger service for config service

* updated logger service for flow service

* updated logger service for git services

* updated logger service for pre-post services

* updated logger util

* updated test cases

* fixed coverage script

* Cli args (#327)

* refactored cli arguments to typedi service

* updated runners

* updated test cases

* Octokit (#328)

* refactored octokit factory to typedi service

* updated config service

* updated github api service

* updated test cases

* CLI argument parsing bug fix (#329)

* placed the bash shebang in the correct entry point file

* fixed cli argument parsing

* updated test cases

* prepare for release, updated changelog, package.json, readme and minor changes

* fixed test case

* push compiled file for actions

Co-authored-by: Enrique Mingorance Cano <ginxaco@gmail.com>
Co-authored-by: Enrique Mingorance Cano <emingora@redhat.com>
Co-authored-by: Github <noreply@github.com>
  • Loading branch information
4 people committed Jan 2, 2023
1 parent 5f5a844 commit 041e212
Show file tree
Hide file tree
Showing 243 changed files with 20,366 additions and 30,921 deletions.
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/index.js
locally_execution/**
node_modules/
build/
./jest.config.ts
46 changes: 46 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"@typescript-eslint/no-explicit-any": [
"error",
{
"fixToUnknown": true
}
],
"curly": "error",
"no-empty": "error",
"no-console": "error",
"no-alert": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_"
}
],
"no-fallthrough": "off",
"arrow-parens": [
"error",
"as-needed"
]
}
}
16 changes: 0 additions & 16 deletions .eslintrc.js

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on:
push:
branches:
- main
- 2.5
paths:
- "package.json"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
22 changes: 20 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ name: Pull Request Checks
on: pull_request

jobs:
build:
unit:
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x]
os: [ubuntu-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand All @@ -21,3 +21,21 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:report

e2e:
strategy:
matrix:
node-version: [14.x, 16.x]
os: [ubuntu-latest]
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:e2e
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
push:
branches:
- main
- typescript/main

name: coverage report

Expand Down Expand Up @@ -30,6 +31,6 @@ jobs:
-Dsonar.tests=test
-Dsonar.testExecutionReportPaths=test-report.xml
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.exclusions=test/**
-Dsonar.exclusions=test/**,**/__mocks__/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ node_modules/
locally_execution/**/*
test/**/_temp/**/*
build_chain_20*/**/*
yarn.lock
/project-dependencies.yaml
coverage/
test-report.xml
.idea/
.vscode/
build/
*.log
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint && npm test
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

# V3.0.0

## Enhancements:
- Complete refactor to typescript
- implemented end to end tests

# V2.6.1

## Enhancements:
Expand Down

0 comments on commit 041e212

Please sign in to comment.