Skip to content

Commit

Permalink
Merge pull request #623 from nexB/fix/packaging-structure
Browse files Browse the repository at this point in the history
Include metadata in release archive, update package names, reduce package size
  • Loading branch information
OmkarPh authored Jan 20, 2024
2 parents 99a1525 + c1edf74 commit 542efce
Show file tree
Hide file tree
Showing 29 changed files with 1,511 additions and 446 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: softprops/action-gh-release@v1
with:
tag_name: ${{steps.tag.outputs.tag}}
name: Release ${{steps.tag.outputs.tag}}
name: ${{steps.tag.outputs.tag}}
body_path: ./Release.md
draft: false
prerelease: false
Expand All @@ -50,12 +50,16 @@ jobs:
node-version: 16.13.0
- name: Install dependencies
run: npm install
- name: Build Workbench & create archive for ${{ matrix.os }}
- name: Create release assets directory
run: mkdir -p dist
- name: Build Workbench & create release archive for ${{ matrix.os }}
run: npm run publish
- name: Verify Generated archive in dist/
- name: Create source code archive (including node_modules)
run: npm run srcarchive
- name: Verify Generated archives in dist/
run: ls ./dist
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
files: dist/*
files: dist/*
20 changes: 20 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The following organizations or individuals have contributed to ScanCode Workbench:

- @Aayush-hub => Aayush Garg
- @AyanSinhaMahapatra => Ayan Sinha Mahapatra
- @camillem => camillem
- @chinyeungli => Chin Yeung
- @dependabot[bot] => null
- @dotarjun => Arjun
- @jdaguil => Jillian Daguil
- @johnmhoran => John M. Horan
- @kopal960 => Kopal Rustagi
- @lakshay-angrish => null
- @OmkarPh => Omkar Phansopkar
- @pombredanne => Philippe Ombredanne
- @pranav1698 => Pranav Kulshrestha
- @Pushpit07 => Pushpit
- @RituRajSingh878 => Ritu Raj Singh
- @steven-esser => Steven Esser
- @Vishal-raj-1 => Vishal Rajput
- @vsvipul => Vipul
24 changes: 23 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a
Changelog <https://keepachangelog.com/en/1.0.0/>`__

[Unreleased (v4.0.1)]
--------------------------

**This ScanCode-Workbench release contains schema changes: scans will have to be re-imported**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--------------------
New Features
~~~~~~~~~~~~

- Support for To-do items by @OmkarPh in #593
- Track & filter reviewed licenses by @OmkarPh in #571

Bug Fixes
~~~~~~~~~

- Fixed Irregular auto-scroll to target path by @OmkarPh in #610
- Fixed all vulnerabilities & updated packages by @OmkarPh in #611
- Restore old app name by @dotarjun in #615
- Fixed compund SPDX expression resolution in detection & clue matches by @OmkarPh in #619
- Reduce release build size by removing redundant `node_modules` dependencies by @OmkarPh in #623


[v4.0.0] - 2023-10-26
--------------------------

Expand Down Expand Up @@ -52,7 +75,6 @@ New Features
- Working indicator for queries
- Diff modal for Matched text & Rule text in Matches table


Bug Fixes
~~~~~~~~~

Expand Down
91 changes: 91 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
============
Contributing
============

Contributions are welcome and appreciated!
Every little bit helps, and a credit will always be given.

.. _issues : https://github.com/nexB/scancode-workbench/issues
__ issues_

If you are new to ScanCode Workbench and want to find easy tickets to work on,
check `easy issues <https://github.com/nexB/scancode-workbench/labels/easy>`_

When contributing to ScanCode Workbench (such as code, bugs, documentation, etc.) you
agree to the Developer `Certificate of Origin <http://developercertificate.org/>`_
and the ScanCode license (see the `NOTICE <https://github.com/nexB/scancode-workbench/blob/develop/NOTICE>`_ file).
The same approach is used by Linux Kernel developers and several other projects.

For commits, it is best to simply add a line like this to your commit message,
with your name and email::

Signed-off-by: Jane Doe <developer@example.com>

Please try to write a good commit message, see `good commit message wiki
<https://aboutcode.readthedocs.io/en/latest/contributing/writing_good_commit_messages.html>`_ for
details. In particular use the imperative for your commit subject: think that
you are giving an order to the codebase to update itself.


Feature requests and feedback
=============================

To send feedback or ask a question, `file an issue <issues_>`_

If you are proposing a feature:

* Explain how it would work.
* Keep the scope as simple as possible to make it easier to implement.
* Remember that your contributions are welcomed to implement this feature!


Chat with other developers
==========================

For other questions, discussions, and chats, we have official Matrix rooms:

- `discuss room <https://matrix.to/#/#aboutcode-org_discuss:gitter.im>`_ (for all projects)
- `scancode-workbench room <https://matrix.to/#/#aboutcode-org_scancode-workbench:gitter.im>`_


Bug reports
===========

When `reporting a bug`__ please include:

* Your operating system name, version, and architecture.
* Your ScanCode Workbench version.
* Any additional details about your local setup that might be helpful to
diagnose this bug.
* Detailed steps to reproduce the bug, such as the scan file you imported, filters you applied, etc.
* The error messages or failure trace if any.
* If helpful, you can add a screenshot as an issue attachment when relevant or
some extra file as a link to a `Gist <https://gist.github.com>`_.


Documentation improvements
==========================

Documentation can come in the form of new documentation pages/sections, tutorials/how-to documents,
any other general upgrades, etc. Even a minor typo fix is welcomed.

If something is missing in the documentation or if you found some part confusing,
please file an issue with your suggestions for improvement. Your help and contribution make ScanCode Workbench docs better, we love hearing from you!

The ScanCode Workbench documentation is hosted at `scancode-workbench.readthedocs.io <https://scancode-workbench.readthedocs.io/en/latest/>`_.

If you want to contribute to Scancode Workbench Documentation, you'll find `this guide here <https://scancode-workbench.readthedocs.io/en/latest/contribute/building.html#building-documentation>`_ helpful.


Pull Request Guidelines
-----------------------

If you need a code review or feedback while you are developing the code just
create a pull request. You can add new commits to your branch as needed.

For merging, your request would need to:

1. Include unit tests that are passing (run ``npm test``).
2. Update documentation as needed for new UI screen, functionality, etc.
3. Add a note to ``CHANGELOG.rst`` about the changes.
4. Add your name to ``AUTHORS.rst``.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ Note: Due to usage of native modules, a build must be done on target platform on
$ npm run publish
```

After building is done, you can find `ScanCode-Workbench` under
`dist/ScanCode-Workbench-<os>-x64-<version>`. Archives (tar.gz and .zip) are
also built.
You can find the executible `ScanCode-Workbench-<version>` inside `out/ScanCode-Workbench-<version>-<os>-<arch>` and distributable archive (.tar.gz or .zip) in `dist/`

## Testing

Expand Down
50 changes: 16 additions & 34 deletions Release.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,25 @@
## Major changes

- Ported to React + Typescript variant !!
Under GSoC by @OmkarPh
- Support for scancode-toolkit v32.x output format v3.0.0
- Updated Tableview library & columns
- New sections: License Detections explorer, Packages explorer, ScanInfo, About
- Support for multiple windows
- Maintain history of imports
- Updated dependencies
- Created UI to support top level packages-deps obtained in latest scans
- Support for Drag & drop JSON/SQLite files
- Github actions to create automated releases
Exception: macos arm64 is not yet support by Github actions yet, needs manual build & upload
- Retain column order & states https://github.com/nexB/scancode-workbench/pull/568
- License clues section in Licenses explorer https://github.com/nexB/scancode-workbench/pull/570
- Go to specific file from licenses & packages explorer https://github.com/nexB/scancode-workbench/pull/572
- Diff modal for Matched text & Rule text in Matches table https://github.com/nexB/scancode-workbench/pull/577
- Working indicator for queries https://github.com/nexB/scancode-workbench/pull/583
- Dashboard updates https://github.com/nexB/scancode-workbench/pull/585
- Close file & cleanup https://github.com/nexB/scancode-workbench/pull/600
- Unit tests https://github.com/nexB/scancode-workbench/pull/591
- Dependency Info dashboard updates https://github.com/nexB/scancode-workbench/pull/594
- Updated documentation https://github.com/nexB/scancode-workbench/pull/602
- Support for To-do items by @OmkarPh in #593
- Track & filter reviewed licenses by @OmkarPh in #571

## ScanCode Toolkit Compatibility

This v4.0.0 of ScanCode Workbench is compatible with scans from any [ScanCode Toolkit](https://github.com/nexB/scancode-toolkit/) releases at or after [`v32.0.0`](https://github.com/nexB/scancode-toolkit/releases/tag/v32.0.0rc4) and also from the latest develop, but using the latest `v32.x` stable releases is recommended: [latest SCTK release](https://github.com/nexB/scancode-toolkit/releases/latest).

## Bug fixes

- Prevent crashes on unsupported scans
- Provision for header-less scans (Test scans)
- Table column fixes
- Fixed UI anomalies
- Invalid path query fix (Data for files with similar prefix were colliding)
- window title update & occasional sqlite error for packages https://github.com/nexB/scancode-workbench/pull/560
- license detection parser issues, trimmed filter options, hide empty 'other dependencies' https://github.com/nexB/scancode-workbench/pull/569
- Refined UX including consistent scrollbars, tooltips, Search in licenses, filters for dependencies https://github.com/nexB/scancode-workbench/pull/587
- Updated piechart tooltip https://github.com/nexB/scancode-workbench/pull/582
- Automatic height for tables https://github.com/nexB/scancode-workbench/pull/606
- Fixed Empty directory being shown with file icon https://github.com/nexB/scancode-workbench/pull/604
- Fix irregular scroll behavior for files in deeply nested FileTree https://github.com/nexB/scancode-workbench/pull/599
- Fixed Irregular auto-scroll to target path by @OmkarPh in #610
- Fixed all vulnerabilities & updated packages by @OmkarPh in #611
- Restore old app name by @dotarjun in #615
- Fixed compund SPDX expression resolution in detection & clue matches by @OmkarPh in #619
- Reduce release build size by removing redundant `node_modules` dependencies by @OmkarPh in #623

## Framework

- Electorn [v28.1.0](https://releases.electronjs.org/release/v28.1.0)
- Chromium [v120.0.6099.109](https://source.chromium.org/chromium/chromium/src/+/refs/tags/120.0.6099.109:)

# New Contributors

- @dotarjun made his first contribution in #615
1 change: 1 addition & 0 deletions SCANCODE_WORKBENCH_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.1
76 changes: 0 additions & 76 deletions archive_builder.py

This file was deleted.

5 changes: 0 additions & 5 deletions attribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ <h2>About ScanCode Workbench 4.0.0:</h2>

<!-- <h2>ScanCode Workbench contains the following software components:</h2> -->
<!-- <h3><a id="End">End</a></h3> -->

<h2>ScanCode Workbench contains the following image assets:</h2>
Import file illustration -
<a href="https://storyset.com/work">Work illustrations by Storyset</a>

<br />
<br />
</body>
Expand Down
42 changes: 42 additions & 0 deletions buildSourceArchive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const os = require("os");
const fs = require("fs");
const path = require("path");
const archiver = require("archiver");
const version = require("./package.json").version;

const archiveDirectory = "dist";
const platform = os.platform();
const arch = os.arch();

// Determine the packaging format based on the OS
const isWindows = platform === "win32";
const archiveFormat = isWindows ? "zip" : "tar";
const archiveExtension = isWindows ? "zip" : "tar.gz";

console.log("Building source archive ...");

// Ensure that the archive destination directory exists
if (!fs.existsSync(archiveDirectory)) {
fs.mkdirSync(archiveDirectory);
}

// Create the archive file with the same name as the package directory
const archiveFileName = `ScanCode-Workbench-${version}-${platform}-${arch}-src.${archiveExtension}`;
const archiveFilePath = path.join(archiveDirectory, archiveFileName);
const output = fs.createWriteStream(archiveFilePath);
const archive = archiver(archiveFormat, { gzip: true });

output.on("close", () => {
console.log(`Created source archive at ${archiveFilePath}`);
});

archive.pipe(output);

archive.glob("**/*", {
dot: true,
cwd: process.cwd(),
ignore: ["dist/**", "out/**", ".git/**"],
});

archive.finalize();
Loading

0 comments on commit 542efce

Please sign in to comment.