Skip to content

Commit 50079a2

Browse files
committed
Merge branch 'dev'
2 parents 361b0e5 + e9ec8df commit 50079a2

File tree

14 files changed

+515
-7
lines changed

14 files changed

+515
-7
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
toolbox/github/data
22
toolbox/diver/data
33
toolbox/gitlab/data
4-
toolbox/utils/_templates/new-GitHub-repository-contributors.fr.template.txt.result
4+
toolbox/utils/text-generator/_templates/new-GitHub-repository-contributors.fr.template.txt.result
5+
toolbox/utils/third-party-generator/components.csv.result
6+
toolbox/utils/third-party-generator/THIRD-PARTY.md.result
7+
toolbox/utils/third-party-generator/__pycache__

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## [2.15.0] - 2024-03-12
11+
12+
### Added
13+
14+
- Project - Generate THIRD-PARTY.md based on user inputs ([#119](https://github.com/Orange-OpenSource/floss-toolbox/issues/119))
15+
1016
## [2.14.0] - 2024-03-01
1117

18+
### Added
19+
1220
- Generate template-based text using variables ([#84](https://github.com/Orange-OpenSource/floss-toolbox/issues/84))
21+
22+
### Changed
23+
1324
- Make CHANGELOG more compliant ([#103](https://github.com/Orange-OpenSource/floss-toolbox/issues/103))
1425

1526
## [2.13.0] - 2023-07-19

CITATION.cff

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ repository-code: 'https://github.com/Orange-OpenSource/floss-toolbox'
1717
url: 'https://github.com/Orange-OpenSource/floss-toolbox/wiki'
1818
abstract: >-
1919
Ths floss-toolbox is a repository which contains
20-
several scripts in Shell, Python and Ruby for
20+
several scripts in Shell, Python, Ruby or PHP for
2121
administrations and forensics purposes.
2222
2323
It exposes scripts to manage GitHub and GitLab
2424
organizations, look for data in repositories,
2525
or scrap licences from dependency managers file.
2626
2727
This tool has been developed so as to help
28-
people to manage open sources projects.
28+
people to manage open source projects.
2929
3030
The project is under permissive non-copyleft
3131
open source license Apache 2.0.
@@ -35,6 +35,9 @@ keywords:
3535
- git
3636
- scripts
3737
- administration
38+
- SBOM
39+
- audits
40+
- history
3841
license: Apache-2.0
39-
version: v2.7.0
40-
date-released: '2023-01-18'
42+
version: v2.15.0
43+
date-released: '2024-03-12'

toolbox/dry-run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ echo -e "\n---------------------------------"
9494
echo "Assertions for the Utils features"
9595
echo "---------------------------------"
9696

97-
RunDryRunInFolder "utils"
97+
RunDryRunInFolder "utils/text-generator"
98+
RunDryRunInFolder "utils/third-party-generator"
9899

99100
# Licenses Inventory tool
100101
# -----------------------

toolbox/utils/README.md renamed to toolbox/utils/text-generator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ brew install php
1414

1515
## Description
1616

17-
Sometimes as open source reference or software forges administrator, we need so send emails to people.
17+
Sometimes as open source referent or software forges administrator, we need so send emails to people.
1818
These emails can be big with lot of details and hyperlinks to resources, and writing them is time expansive.
1919
Because these emails are almost the same (except with some details), we can generate them using a template and variables.
2020

File renamed without changes.
File renamed without changes.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Utils
2+
3+
# Generate THIRD-PARTY.md fromuser inputs
4+
5+
## Prerequisites
6+
7+
- Python 3.8
8+
9+
## Description
10+
11+
Sometimes as open source referent or developer, we need to define file listing third-party components.
12+
This type of file must contain, for eeach component, its name, cipyright, license (wih URL pointing to its text) and also the version and the copyright owners.
13+
It can be a bit broing to fill each time the text or markdown file, that is the reason why this tool has been defined.
14+
15+
### Ask inputs from user
16+
17+
A first script will ask the user for details about the components he or she wants to add in the final THIRD-PARTY file.
18+
To do that:
19+
```shell
20+
python3.8 third-party-prompt.py
21+
```
22+
23+
This Python script will first check if some previous file still exists, i.e. if previous data can be reused (because the operation was paused before).
24+
If the file exists, the script will prompt the user to keep or get rid of it (default).
25+
Once the script completes, a local CSV file must appear or be updated (named *components.csv.result*).
26+
27+
### Generate the THIRD-PARTY file
28+
29+
Then once some CSV file exists, defined thanks to the previous script or for example given by someone else who already made a list, the other script can be used
30+
so as to iterate on each component and build the final Markdown file.
31+
32+
```shell
33+
# --file: the path to the CSV file containing the details
34+
# --delimiter: to define how to split each row fields. Do not forget to escape it if ';'
35+
python3.8 third-party-generator.py --file components.csv.result --delimiter \;
36+
```
37+
38+
### About the CSV file
39+
40+
The CSV file produced by the script *third-party-prompt.py* or processed by *third-party-generator.py* must follow the format above:
41+
42+
```csv
43+
name;repository;licenseName;copyright;version
44+
```
45+
46+
Meaning:
47+
- ";" symbol as delimiter
48+
- name: the name of the component
49+
- repository: the hyperlink to the repository to get the sources for the readers
50+
- licenseName: the name of the license in SPDX short-identifier (cf *licenses.py*)
51+
- copyright: the copyright owners
52+
- version: the verison of the component
53+
54+
55+
For example, with the CSV file bellow
56+
```csv
57+
SwiftUI-Flow;https://github.com/tevelee/SwiftUI-Flow;MIT;Copyright (c) 2023 Laszlo Teveli;1.2.0
58+
BottomSheet;https://github.com/lucaszischka/BottomSheet;MIT;Copyright (c) 2021-2022 Lucas Zischka;3.1.1
59+
DeclarationAccessibility;https://github.com/Orange-OpenSource/accessibility-statement-lib-ios;Apache-2.0;Copyright (c) 2021-2023 Orange SA;1.2.0
60+
```
61+
62+
the produced Markdown (called *THIRD-PARTY.md.result*) will be:
63+
```markdown
64+
\# Third Party Softwares
65+
66+
This document contains the list of Third Party Softwares along with the license information.
67+
68+
Third Party Software may impose additional restrictions and it is the user's responsibility to ensure that they have met the licensing
69+
requirements of the relevant license of the Third Party Software they are using.
70+
71+
\## SwiftUI-Flow
72+
73+
Version 1.2.0
74+
75+
Copyright Copyright (c) 2023 Laszlo Teveli
76+
77+
**SwiftUI-Flow** is distributed under the terms and conditions of the [MIT License](https://opensource.org/license/mit).
78+
You may download the source code on the [following website](https://github.com/tevelee/SwiftUI-Flow).
79+
80+
81+
\## BottomSheet
82+
83+
Version 3.1.1
84+
85+
Copyright Copyright (c) 2021-2022 Lucas Zischka
86+
87+
**BottomSheet** is distributed under the terms and conditions of the [MIT License](https://opensource.org/license/mit).
88+
You may download the source code on the [following website](https://github.com/lucaszischka/BottomSheet).
89+
90+
91+
\## DeclarationAccessibility
92+
93+
Version 1.2.0
94+
95+
Copyright Copyright (c) 2021-2023 Orange SA
96+
97+
**DeclarationAccessibility** is distributed under the terms and conditions of the [Apache-2.0 License](https://opensource.org/license/apache-2-0).
98+
You may download the source code on the [following website](https://github.com/Orange-OpenSource/accessibility-statement-lib-ios).
99+
```
100+
101+
### About the licenses.py file
102+
103+
There is plenty of licenses and also a lot of standards. It can be a pain or time consuming to let the user write the license in use for a component,
104+
then find there URL point to the license text and write it. In fact, such details are still known so we can let the user choose.
105+
The *licenses.py* file lists main licenses we can meet during audits. Each entry in this dictionary has a license name in SPDX short-identifier format and the URL pointing to the license text. Thus these details will be added in the THIRD-PARTY file.$

0 commit comments

Comments
 (0)