Skip to content

Commit

Permalink
Generate automatic che-theia built-in report
Browse files Browse the repository at this point in the history
Generate an automatic report about the update status of che-theia built-in extensions

See eclipse-che/che#17328
See eclipse-che/che#17014

Signed-off-by: Eric Williams <ericwill@redhat.com>
  • Loading branch information
ericwill committed Jul 17, 2020
1 parent 727b6c5 commit 41012ce
Show file tree
Hide file tree
Showing 13 changed files with 11,480 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-built-in-extension-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

# Publish automated plugin report to GH pages
name: publish

on:
push:
branches: [ master ]
schedule:
- cron: '0 1 * * *'
jobs:
publish:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Get current time
uses: 1466587594/get-current-time@v1
id: current-date-time
with:
format: YYYY-MM-DD
- name: publish
env:
DATE_TIME: "${{ steps.current-date-time.outputs.formattedTime }}"
run: |
./tools/automation/.ci/publish-report.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ asset-*
che-editor-plugin.tar.gz
inner-theia
.git-che-theia-sha1

# Reports
index.md
28 changes: 28 additions & 0 deletions tools/automation/.ci/publish-report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

set -e
set -o pipefail

cd ./tools/automation
yarn
yarn run compile
node ./lib/check-extension-updates.js
cd ./report
../node_modules/.bin/vuepress build
cd ./.vuepress/dist
git config --global user.email "che-bot@eclipse.org"
git config --global user.name "CHE Bot"
git init .
git checkout --orphan gh-pages
git add ./*
git commit -m "Automated Built-In Extensions Report $DATE_TIME" -s
git push -f "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/eclipse/che-theia.git" gh-pages
19 changes: 19 additions & 0 deletions tools/automation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Automation

Che-theia makes use of theia built-in extensions, located [here](https://github.com/eclipse-theia/theia/blob/master/package.json). The corresponding che-theia list of extensions is located [here](https://github.com/eclipse/che-theia/blob/master/generator/src/templates/theiaPlugins.json).

This directory contains various scripts which automate various maintenance steps of the registry.

## Automatic Plugin Reports

Every day at 01:00 UTC, the `theiaPlugins.json` file is parsed and a report is generated. The report can be found at https://eclipse.github.io/che-theia/.

The report format (with two sample entries) is as follows:

| Extension Name | Che-Theia Version | Theia Version | Error |
| ------ | ------ | ------ | ------
| vscode-builtin-bat | 1.39.1-prel | **1.44.2** | |
| vscode-builtin-css | 1.44.2 | 1.44.2 | |


When the che-theia version of a built-in extension is out of date, the far-right column "Theia Version" entry is bolded. If an error occurred while checking the extension, it will be reported in the "Error" column.
126 changes: 126 additions & 0 deletions tools/automation/lib/check-extension-updates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tools/automation/lib/check-extension-updates.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions tools/automation/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "built-in-extensions-update-automation",
"version": "0.0.0",
"private": true,
"description": "Scripts for updating, adding, removing, and building extensions in che-theia",
"main": "check-extension-updates.js",
"scripts": {
"build": "yarn run format && yarn run compile && yarn run lint",
"compile": "tsc --project .",
"format": "prettier --write **/*.ts **/**/*.ts package.json",
"format-check": "prettier --check **/*.ts **/**/*.ts package.json",
"lint": "eslint . --ext .ts",
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/eclipse/che-theia.git"
},
"author": "",
"license": "EPL-2.0",
"bugs": {
"url": "https://github.com/eclipse/che/issues"
},
"homepage": "https://github.com/eclipse/che-theia/blob/master/tools/automation/README.md",
"dependencies": {
"download": "^8.0.0",
"fs-extra": "^9.0.1",
"handlebars": "^4.7.6",
"moment": "^2.27.0",
"semver": "^7.3.2",
"simple-git": "^2.12.0",
"vsix-info": "^0.0.3"
},
"devDependencies": {
"@types/fs-extra": "^9.0.1",
"@types/jest": "^25.2.2",
"@types/semver": "^7.3.1",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.11.0",
"import-sort-style-eslint": "^6.0.0",
"jest": "^26.0.1",
"prettier": "^2.0.5",
"prettier-plugin-import-sort": "^0.0.4",
"ts-jest": "^26.1.0",
"ts-mockito": "^2.5.0",
"ts-node": "^8.10.1",
"tslint": "^6.1.2",
"typescript": "^3.9.0",
"vuepress": "^1.5.2"
},
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.ts"
],
"coverageDirectory": "./coverage",
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"<rootDir>/dist"
],
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
]
},
"prettier": {
"printWidth": 120,
"singleQuote": true
},
"importSort": {
".ts": {
"style": "eslint",
"parser": "typescript"
}
}
}
5 changes: 5 additions & 0 deletions tools/automation/report/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
title: 'Automatic Built-In Extension Report',
description: 'Check to see if any built-in theia extensions need to be updated.',
base: '/che-theia/'
}
8 changes: 8 additions & 0 deletions tools/automation/src/check-extension-update-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Automated Built-In Extensions Report

### Report accurate as of: {{reportTime}} UTC / (took {{computeTime}}s)
| Extension Name | Che-Theia Version | Theia Version | Error |
| ------ | ------ | ------ | ------
{{#each entries}}
| {{this.extensionName}} | {{this.cheTheiaVersion}} | {{#if this.needsUpdating}}**{{/if}}{{this.theiaVersion}}{{#if this.needsUpdating}}**{{/if}} | {{this.errors}}
{{/each}}
Loading

0 comments on commit 41012ce

Please sign in to comment.