Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 18 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,24 @@ jobs:
run: npm ci

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

- name: Validate build result
if: ${{ matrix.browser == 'firefox' }}
run: |
npm install -g web-ext

# lint the extension before signing
web-ext lint \
--source-dir="./dist" \
--output=json \
--pretty \
--warnings-as-errors
LINT_EXIT_CODE=$?
if [ $LINT_EXIT_CODE -ne 0 ]; then
echo "::error::Linting failed with exit code $LINT_EXIT_CODE. Build validation for Firefox failed."
exit 1
fi

- name: Upload extension zip
uses: actions/upload-artifact@v4
Expand Down
83 changes: 65 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
name: Deploy Browser Extension

on:
workflow_dispatch:
inputs:
browser:
description: Browser platform to build for as an array (e.g., '["chrome"]", '["firefox", "chrome"]')
required: false
default: '["chrome", "firefox"]'
type: string
tag:
description: Tag to deploy (e.g., "ecu-test-diff-1.0.0")
required: true
type: string
push:
tags:
- 'ecu-test-diff-[0-9]+.[0-9]+.[0-9]+'
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
setup:
runs-on: ubuntu-latest
outputs:
tag-version: ${{ steps.set-tag.outputs.tag-version }}
steps:
- name: Set tag
id: set-tag
run: |
# determine if the workflow was triggered by a dispatch event or a tag push, and set the tag version accordingly
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
TAG_VERSION="${{ github.event.inputs.tag }}"
# validate tag version
if [[ ! $TAG_VERSION =~ ^ecu-test-diff-[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Invalid tag version format. Expected format: ecu-test-diff-x.y.z"
exit 1
fi
echo "tag-version=$TAG_VERSION" >> $GITHUB_OUTPUT
else
TAG_VERSION="${GITHUB_REF#refs/tags/}"
echo "tag-version=$TAG_VERSION" >> $GITHUB_OUTPUT
fi
version-check:
needs: set-tag
runs-on: ubuntu-latest
if: |
startsWith(github.ref, 'refs/tags/ecu-test-diff-') ||
github.event_name == 'release'
outputs:
proceed: ${{ steps.version-check.outputs.proceed }}
steps:
Expand All @@ -27,18 +51,17 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y jq

# Tag ref of release refs/tags/<tag_name> as well
TAG_VERSION="${GITHUB_REF#refs/tags/ecu-test-diff-}"
TAG_VERSION="${{ needs.setup.outputs.tag-version }}"
MANIFEST_VERSION=$(jq -r '.version' static/manifest.json)
echo "Tag version: $TAG_VERSION"
echo "Manifest version: $MANIFEST_VERSION"


# extract the version from the tag
TAG_VERSION=${TAG_VERSION#ecu-test-diff-}
if [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then
echo "❌ Tag version ($TAG_VERSION) does not match manifest version ($MANIFEST_VERSION)."
echo "proceed=false" >> $GITHUB_OUTPUT
exit 1
elif [[ "{{ github.event_name }}" == "release" ]]; then
]]
fi

echo "✅ Tag version matches manifest version."
Expand All @@ -48,22 +71,46 @@ jobs:
needs: version-check
if: needs.version-check.outputs.proceed == 'true'
uses: ./.github/workflows/build.yml
with:
browser: ${{ fromJSON(github.event.inputs.browser || '["chrome", "firefox"]') }}

publish:
needs: [version-check, build]
if: ${{ github.env.DEPLOYMENT == 'True' }}
runs-on: ubuntu-latest
strategy:
matrix:
browser: ['chrome'] # After supporting multiple browsers, this will be changed to ["chrome", "firefox"]
browser: ${{ fromJSON(github.event.inputs.browser || '["chrome", "firefox"]') }}
steps:
- name: Get artifact from build job
uses: actions/download-artifact@v4
with:
name: ${{ matrix.browser }}-extension
- name: Publish to Firefox Add-on
- name: Set up Node v20
if: ${{ matrix.browser == 'firefox' }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Install web-ext
if: matrix.browser == 'firefox'
run: npm install -g web-ext
- name: Publish as Firefox add-on
if: ${{ matrix.browser == 'firefox' }}
run: echo "Publishing to Firefox Add-on is not implemented yet."
env:
AMO_JWT_ISSUER: ${{ secrets.AMO_JWT_ISSUER }}
AMO_JWT_SECRET: ${{ secrets.AMO_JWT_SECRET }}
run: |
# extract artifact
mkdir -p "./${{ matrix.browser }}-extension"
unzip -o "${{ matrix.browser }}-extension.zip" -d "./${{ matrix.browser }}-extension"

# sign the extension
web-ext sign \
--api-key="$AMO_JWT_ISSUER" \
--api-secret="$AMO_JWT_SECRET" \
--channel=listed \
--source-dir="./${{ matrix.browser }}-extension"
- name: Publish to Chrome Web Store
if: ${{ matrix.browser == 'chrome' }}
uses: mnao305/[email protected]
Expand Down
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [Description](#description)
- [Features](#features)
- [Getting started](#getting-started)
- [Installing and running](#installing-and-running)
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)
- [Contribution](#contribution)
Expand All @@ -12,9 +12,11 @@

## Description

Browser plugin to open the diff viewer of tracetronic products ecu.test and trace.check from browser.
Browser extension 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.
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

Expand All @@ -36,17 +38,18 @@ Detected file extensions

## Getting started

### Installing and running
### Installation

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!):
To install the extension, use the specific installation method for your browser.

**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.
1. Click extension icon in the top right corner or Go to "https://addons.mozilla.org" and continue with step 3
2. Click on the "Manage extensions" button
3. Click on "Find more add-ons" and type "Open with ecu.test diff"
4. Click on the "Add to Firefox" button
5. Click on "Add" in the pop-up dialog
6. Click on "OK" in the pop-up dialog (if needed)

**Chrome/Edge**

Expand All @@ -64,30 +67,31 @@ You are good to go! You can also pin the extension to the toolbar for easy acces
- Select the correct platform type and add the host
- Go to the options e.g., via click on the cog-wheel icon
- Now enter your API token
- ⚠️Don't give the token all permissions⚠️
- ⚠️Don not give the token all permissions⚠️
- Only reading repository and API access
- fine-grained tokens are recommended

<img src="./docs/images/chrome/configuration.png" alt="Configuration" width="800"/>
<img src="./docs/images/firefox/configuration.png" alt="Configuration" width="800"/>

- Save the settings
- Go back to the commit page and open the popup again
- The supported files of the changes will be listed

<img src="./docs/images/chrome/dialog.png" alt="Configuration" width="600"/>
<img src="./docs/images/firefox/dialog.png" alt="Configuration" width="600"/>

- 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).
For detailed documentation on features, build and development setup, see the [DeveloperGuide](./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).
To report a bug or request an enhancement to this extension,
please raise a new [GitHub issue](https://github.com/tracetronic/ecu.test-diff/issues).

### Support

Expand All @@ -101,7 +105,7 @@ This project uses the [Red Hat Display Text Font](https://github.com/RedHatOffic

This project uses the [Material Symbols Outlined Font](https://fonts.google.com/icons) with is licensed under Apache License Version 2.0 (see [Apache-2.0.txt](./LICENSES/Apache-2.0.txt))

To generate a software bill of material (sbom) we recommend using the [cyclondx](https://github.com/CycloneDX/cyclonedx-node-npm) tool:
To generate a software bill of material (sbom), we recommend using the [CycloneDX](https://github.com/CycloneDX/cyclonedx-node-npm) tool:

```bash
#skip if you have cyclonedx already installed globally
Expand Down
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version = 1
SPDX-PackageName = "ecu.test diff plugin"
SPDX-PackageName = "ecu.test diff extension"
SPDX-PackageSupplier = "2025 tracetronic GmbH <[email protected]>"
SPDX-PackageDownloadLocation = "https://github.com/tracetronic/ecu.test-diff"

Expand Down
Loading