Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e09e67e
Sync files from GitLab (#1)
MartinGroscheTT Apr 1, 2025
a260f2b
Add GitHub Actions workflow for building extension (#1)
MartinGroscheTT Apr 1, 2025
2aca24d
Disable ESLint and TSLint rules in test setup for chrome API mocking …
MartinGroscheTT Apr 1, 2025
8661cd2
Update import statement to use .js extension for types (#1)
MartinGroscheTT Apr 1, 2025
43dad4f
Upgrade dependencies and clean project (#1)
MartinGroscheTT Apr 2, 2025
e0dc993
Fix zip file creation path in GitHub Actions workflow (#1)
MartinGroscheTT Apr 2, 2025
07a84ca
Update GitHub Actions workflow to upload built extension files direct…
MartinGroscheTT Apr 2, 2025
b8c3313
Update review notes (#1)
MartinGroscheTT Apr 3, 2025
f7ce39d
Sync internal GitLab repo (#1)
MartinGroscheTT Apr 7, 2025
27b899b
Refactor GitHub Actions workflow to separate testing into its own fil…
MartinGroscheTT Apr 7, 2025
0fa7196
Remove workflow_dispatch trigger from test workflow configuration (#1)
MartinGroscheTT Apr 7, 2025
9c90212
Refactor build workflow to use separate test workflow file (#1)
MartinGroscheTT Apr 7, 2025
1d7e1de
Enhance test workflow to support multiple Node.js versions (#1)
MartinGroscheTT Apr 7, 2025
4c2025b
Update documentation structure and add CI information (#1)
MartinGroscheTT Apr 8, 2025
06b6e64
Provide REUSE compliance check workflow (#1)
MartinGroscheTT Apr 8, 2025
f6f6de8
Add SPDX SBOM generation and upload to REUSE workflow (#1)
MartinGroscheTT Apr 8, 2025
df1115c
Update Developer Guide to clarify SBOM output location in REUSE workf…
MartinGroscheTT Apr 8, 2025
e410125
Rename workflow (#1)
MartinGroscheTT Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
20 changes: 20 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"browser": true,
"node": true,
"mocha": true
},
"rules": {
"@typescript-eslint/no-var-requires": 0
}
}
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build Browser Extension

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
test:
strategy:
matrix:
node-version: [18, 20]
uses: ./.github/workflows/test.yml
with:
node-version: ${{ matrix.node-version }}

build:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chrome, firefox]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install dependencies
run: npm ci

- name: Build extension for ${{ matrix.browser }}
run: npm run build-${{ matrix.browser }}

- name: Upload extension zip
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.browser }}-extension
path: dist/*
if-no-files-found: error
32 changes: 32 additions & 0 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: REUSE Compliance Check

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
reuse-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: REUSE Compliance Check
uses: fsfe/reuse-action@v5

- name: REUSE SPDX SBOM
uses: fsfe/reuse-action@v5
with:
args: spdx -o sbom.spdx

- name: Upload spdx
uses: actions/upload-artifact@v4
with:
name: spdx-sbom
path: sbom.spdx
if-no-files-found: error
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test

on:
workflow_call:
inputs:
node-version:
description: 'Node.js version to use for tests'
required: true
type: number
outputs:
test-result:
description: 'Test result'
value: ${{ jobs.test.outputs.result }}

jobs:
test:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.test-result.outputs.result }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install dependencies
run: npm ci

- name: Lint code
run: npm run lint

- name: Run tests
run: npm test

- name: Set test result
id: test-result
run: echo "result=$(if [ $? -eq 0 ]; then echo 'success'; else echo 'failure'; fi)" >> $GITHUB_OUTPUT
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
coverage
node_modules
.DS_Store
.env
6 changes: 6 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"required": ["ts-node/register", "tsconfig-paths/register"],
"extension": ["ts", "js"],
"loader": "ts-node/esm",
"spec": ["./test/setup.ts", "./test/**/*.ts"]
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"endOfLine": "auto",
"tabWidth": 2
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 tracetronic GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions LICENSE.original
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Sebastian Szczepański

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
MIT License

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
93 changes: 91 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,92 @@
# ecu.test-diff
# ecu.test Diff Extension <!-- omit in toc -->

placeholder
- [Description](#description)
- [Features](#features)
- [Getting started](#getting-started)
- [Installing and running](#installing-and-running)
- [Usage](#usage)
- [Documentation](#documentation)
- [Contribution](#contribution)
- [Support](#support)
- [Licensing](#licensing)

## Description

Browser plugin to open the diff viewer of tracetronic products ecu.test and trace.check from browser.

ecu.test Diff Extension is a bridge between the current browser tab and an installed ecu.test. It allows you to diff packages (`.pkg`) and other artifacts from an open commit or merge request with only a few simple clicks.

## Features

Supported SCM platforms:
- GitHub
- GitLab

Supported entry points
- Single commits
- Merges

Detected file extensions
- `.pkg`
- `.prj`
- `.trf` (view only, no diff)

## Getting started

### Installing and running

TODO: The extention is not yet released on chrome or firefox app stores!

Use the extention in development mode (this mode is probably forbidden via company IT rules!):

**Firefox**

1. Download the relevant .xpi file from releases.
2. Go to `about:debugging#/runtime/this-firefox`
3. Click on load temporary addon select the .xpi file.
**Chrome/Edge**

1. Download the relevant .crx file from releases.
2. Go to `chrome://extensions/`
3. Enable development mode
4. Drag .crx into the window (if it is not working, reload window once)

You are good to go! You can also pin the extension to the toolbar for easy access.

### Usage
- Open a commit or merge request on your SCM platform. Open the extention popup dialog.
- Select the correct platform type and add the host.
- Go to the options. E.g., via click on the cog wheel icon.
- Now enter you API token. Don't give the token all permissions! Only reading repository and API access. So create fine-grained tokens!
- Save the settings
- Go back to the commit page and open the popup again.
- The supported files of the changes will be listed.
- Click on a file and click on "Show diff".
- ecu.test Diff-Viewer will be opened. This needs ecu.test installed and a valid license available!

### Documentation
A detailed documentation on features, build and development setup can be found inside [docs folder](docs\DeveloperGuide.md).

### Contribution
At the moment, no external contributions are intended and merge requests from forks will automatically be rejected!
To report a bug or request an enhancement to this plugin please raise a new [GitHub issue](https://github.com/tracetronic/ecu.test-diff/issues).

### Support

If you have any further questions, please contact us at [[email protected]](mailto:[email protected]).

### Licensing
This work is licensed under MIT license. This project is based on the boilerplate [Chrome Extension Webpack](https://github.com/sszczep/chrome-extension-webpack) from Sebastian Szczepański. You can find the original license text inside [LICENSE.original](./LICENSE.original).

To generate a software bill of material (sbom) we recommend using the [cyclondx](https://github.com/CycloneDX/cyclonedx-node-npm) tool:
```bash
#skip if you have cyclonedx already installed globally
npm install --global @cyclonedx/cyclonedx-npm

cyclonedx-npm --output-format json --output-file bom.json

#uninstall cyclonedx if desired
npm uninstall --global @cyclonedx/cyclonedx-npm
```
The generated sbom destination is ./bom.json by default. It can be changed using the options
`--output-format` or `--output-file`.
10 changes: 10 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version = 1
SPDX-PackageName = "ecu.test diff plugin"
SPDX-PackageSupplier = "2025 tracetronic GmbH <[email protected]>"
SPDX-PackageDownloadLocation = "https://github.com/tracetronic/ecu.test-diff"

[[annotations]]
path = ["**"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 tracetronic GmbH"
SPDX-License-Identifier = "MIT"
7 changes: 7 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"]
}
Loading