Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master into prod in preparation of release v2.0.0 #607

Merged
merged 131 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
f1f1433
Licensee, Ruby and its dependency updated in Dockerfile and DevDocker…
yashkohli88 Jan 30, 2024
a43d7c8
Update Licensee, Ruby and its dependency
yashkohli88 Jan 31, 2024
a4d2fda
Update scancode-toolkit to latest version and adjust CLI usage
lumaxis Dec 8, 2023
26d53aa
Remove commented-out lines from Dockerfile
lumaxis Dec 8, 2023
b83414f
Use CMD instead of ENTRYPOINT in DevDockerfile
lumaxis Dec 8, 2023
d987bef
Update code to work with new scancode version output format
lumaxis Dec 8, 2023
39455b7
Reformat and clean-up launch.json
lumaxis Dec 8, 2023
740c762
Update cdConfig.js with new scancode CLI arguments
lumaxis Dec 8, 2023
236234b
Update fixtures
lumaxis Jan 18, 2024
1dd0c45
Add a unit test to verify self link for PodExtract
qtomlinson Apr 9, 2024
794fef2
Isolate toolVersion from schemaVersion in PodExtract
qtomlinson Apr 10, 2024
bbf6133
Bump up the version in PodExtract
qtomlinson Apr 10, 2024
9424f37
Add a unit test to PodExtractTests
qtomlinson Apr 10, 2024
32eaf2b
Bump up the tool version in PodExtract
qtomlinson Apr 17, 2024
14a3dca
Updated request-promise-native
yashkohli88 Apr 23, 2024
8dc8733
Updated request-promise-native
yashkohli88 Apr 23, 2024
fa37b7f
Updated request-promise-native
yashkohli88 Apr 29, 2024
a1bff29
Merge branch 'master' into update-scancode-toolkit
lumaxis Apr 30, 2024
347047b
Merge branch 'master' into yk/licensee-upgrade
lumaxis Apr 30, 2024
1edb1bb
Merge branch 'master' into qt/pod_tool_version
qtomlinson May 2, 2024
39ddcda
Updated request-promise-native
yashkohli88 May 2, 2024
b83702b
Updated request-promise-native
yashkohli88 May 2, 2024
a3ffa52
Merge branch 'master' into qt/pod_tool_version
lumaxis May 6, 2024
527b1d6
Update rimraf to latest version
lumaxis May 6, 2024
ab0c920
Replace rimraf with native function
lumaxis May 6, 2024
6dc32f1
Merge branch 'master' into update-scancode-toolkit
lumaxis May 13, 2024
a4e59a5
Use latest ScanCode version
lumaxis May 13, 2024
af3e7f7
Add .prettierignore file
lumaxis May 13, 2024
64ab636
Update fixtures for ScanCode version 32.1.0
lumaxis May 13, 2024
766cb35
Merge branch 'master' into qt/pod_tool_version
lumaxis May 14, 2024
d3e385c
Merge branch 'master' into yk/licensee-upgrade
lumaxis May 14, 2024
e2691ee
Updated request-promise-native
yashkohli88 May 15, 2024
e26e696
Merge branch 'master' into pr/576
yashkohli88 May 15, 2024
0796e7d
Fixed formatting
yashkohli88 May 15, 2024
5f8125c
Fixed formatting
yashkohli88 May 15, 2024
109e4bf
Merge branch 'master' into update-rimraf
elrayle May 24, 2024
6d0bff9
Merge pull request #558 from lumaxis/update-rimraf
elrayle May 24, 2024
fda6416
Remove VS Code launch config for istanbul
lumaxis Feb 15, 2024
f5e86b1
Remove unused istanbul dependency
lumaxis Feb 15, 2024
6b82f9c
Remove unused dependencies
lumaxis Feb 15, 2024
c3694b1
Explicitly add required dependencies
lumaxis May 27, 2024
20192ee
Merge pull request #557 from lumaxis/cleanup-dependencies
lumaxis May 27, 2024
585d6a6
Merge branch 'master' into update-scancode-toolkit
lumaxis May 28, 2024
5926c39
Add separate job for testing Docker build
lumaxis May 30, 2024
b30cf8f
Merge branch 'master' into qt/pod_tool_version
qtomlinson Jun 5, 2024
80652ad
Merge pull request #566 from qtomlinson/qt/pod_tool_version
qtomlinson Jun 5, 2024
7fe50cd
Merge branch 'master' into yk/licensee-upgrade
qtomlinson Jun 5, 2024
3654c64
Bump express from 4.18.2 to 4.19.2
dependabot[bot] Jun 7, 2024
8433592
Merge pull request #564 from clearlydefined/dependabot/npm_and_yarn/e…
elrayle Jun 7, 2024
1b16e52
Bump debug from 4.1.1 to 4.3.5
dependabot[bot] Jun 7, 2024
2ce4fdf
Merge pull request #581 from clearlydefined/dependabot/npm_and_yarn/d…
elrayle Jun 7, 2024
3411b76
Merge pull request #580 from clearlydefined/actions-docker-build-job
lumaxis Jun 10, 2024
20eda0c
Merge branch 'master' into update-scancode-toolkit
lumaxis Jun 10, 2024
2b1858f
Merge branch 'master' into yk/licensee-upgrade
qtomlinson Jun 10, 2024
2372734
Update Docker instructions
lumaxis Jun 12, 2024
88fe13f
Merge pull request #549 from yashkohli88/yk/licensee-upgrade
qtomlinson Jun 12, 2024
5293975
Undo DevDockerfile changes to ENTRYPOINT
lumaxis Jun 12, 2024
1c0cf99
Revert "Update Docker instructions"
lumaxis Jun 12, 2024
fdcb0de
Bump braces and patch-package
dependabot[bot] Jun 13, 2024
0bf8e0f
Merge branch 'master' into update-scancode-toolkit
lumaxis Jun 13, 2024
8cee2df
Updated request-promise-native
yashkohli88 Jun 14, 2024
f8c500f
Merge branch 'master' into pr/576
yashkohli88 Jun 14, 2024
dbe50fd
docs: add SECURITY.md
Jun 19, 2024
e3983fd
Merge pull request #582 from clearlydefined/dependabot/npm_and_yarn/m…
qtomlinson Jun 24, 2024
338ae84
Merge branch 'master' into update-scancode-toolkit
qtomlinson Jun 26, 2024
8f692e6
Merge pull request #537 from lumaxis/update-scancode-toolkit
qtomlinson Jun 26, 2024
e109cac
work in progress
qtomlinson Jul 6, 2024
d512582
Add handling of simple
qtomlinson Jul 7, 2024
2fc4a8e
Fix simple
qtomlinson Jul 7, 2024
81e803e
Derive license from info.license over classifiers in pypi registry data
qtomlinson Jul 8, 2024
b5bde97
Merge branch 'master' into security
nickvidal Jul 11, 2024
5d8ecbe
Merge pull request #584 from nickvidal/security
nickvidal Jul 11, 2024
5e13b1e
Merge pull request #1 from qtomlinson/qt/pull_fetch
yashkohli88 Jul 12, 2024
54b6c32
Update request-promise-native
yashkohli88 Jul 12, 2024
250d785
Support uri in options
qtomlinson Jul 12, 2024
7b0d444
Merge pull request #2 from qtomlinson/qt/pull_request_upgrade
yashkohli88 Jul 16, 2024
42ec1cf
Merge branch 'master' into yk/update-request-promise-native
yashkohli88 Jul 24, 2024
0a0720d
Update package-lock.json
yashkohli88 Jul 24, 2024
d9fbf6f
Fix formatting
yashkohli88 Jul 24, 2024
0817188
Fix fetching latest version for some pod components
qtomlinson Jul 23, 2024
adc6832
Merge pull request #576 from yashkohli88/yk/update-request-promise-na…
qtomlinson Aug 2, 2024
5dd9baa
Make crawler queue configurable as separate hosting
ljones140 Aug 6, 2024
254deb0
vacous push
ljones140 Aug 6, 2024
70129db
remove blank line
ljones140 Aug 6, 2024
66751b7
Rename var
ljones140 Aug 9, 2024
ad09a10
Add seperate Azure queue to documentation
ljones140 Aug 9, 2024
9f33ed1
Prettier Readme
ljones140 Aug 9, 2024
a56c13d
Merge pull request #591 from ljones140/master
elrayle Aug 12, 2024
caa8c12
tests should run for changes in prod and have the option to run manually
elrayle Aug 12, 2024
73e8e16
run test action for prod and allow manual run
elrayle Aug 12, 2024
ae32c98
update version to v1.2.0
elrayle Aug 12, 2024
6a55052
Merge branch 'master' into qt/fix_pod_latest_version
qtomlinson Aug 12, 2024
dc8d5a2
Merge pull request #588 from qtomlinson/qt/fix_pod_latest_version
qtomlinson Aug 13, 2024
2c1f105
Merge branch 'master' into qt/fix_pypi_license
qtomlinson Aug 14, 2024
0419fd3
Introduce a new traversal policy
qtomlinson Sep 24, 2024
7655ebc
Action to deploy to dev
ljones140 Sep 26, 2024
da414ce
Don't automatically run on master push yet
ljones140 Sep 26, 2024
85544f8
Merge pull request #586 from qtomlinson/qt/fix_pypi_license
qtomlinson Sep 26, 2024
4728d99
Merge branch 'master' into deploy-dev-action
ljones140 Sep 27, 2024
a394fde
Merge pull request #599 from clearlydefined/deploy-dev-action
ljones140 Sep 27, 2024
c27d0de
Deploys to dev on master merge
ljones140 Sep 27, 2024
20d440b
Merge branch 'master' into qt/add_policy
qtomlinson Sep 27, 2024
f0fb76a
Merge pull request #598 from qtomlinson/qt/add_policy
qtomlinson Sep 27, 2024
be282d4
Merge branch 'master' into enable-dev-deploy-on-master-merge
ljones140 Sep 30, 2024
3e1fdc8
Merge pull request #601 from clearlydefined/enable-dev-deploy-on-mast…
ljones140 Sep 30, 2024
ce50ee8
add sha and version to ‘/‘ endpoint
elrayle Apr 30, 2024
506fa2a
Add app version to logger
ljones140 Oct 1, 2024
7c43743
point to branch of deploy workflow to test
ljones140 Oct 1, 2024
9ca70dd
Update action branch
ljones140 Oct 1, 2024
7155482
Update workflow branch
ljones140 Oct 1, 2024
a4f31b4
Full branch needed
ljones140 Oct 1, 2024
79fc235
Update to current release of workflow
ljones140 Oct 3, 2024
99cb4a3
Remove build numbder
ljones140 Oct 3, 2024
ef89a38
Merge pull request #574 from clearlydefined/elr/ver-sha
ljones140 Oct 15, 2024
52e7c26
Update spdx
ljones140 Oct 18, 2024
edbcaf5
Merge branch 'prod' into master
elrayle Oct 20, 2024
0738316
Merge pull request #606 from clearlydefined/ljones140/bump-spdx
ljones140 Oct 21, 2024
b5348fb
Update deployment pipeline
ljones140 Oct 21, 2024
d727cf3
Update dev workflow to latest
ljones140 Oct 21, 2024
6711e92
Update to new version of base workflow
ljones140 Oct 22, 2024
f5d29a8
Trigger prod deploy on release publish
ljones140 Oct 23, 2024
6f3dc56
Make scancode parallelism configurable
RomanIakovlev Oct 23, 2024
259b9f3
Get scancode parallelism value from standard config
RomanIakovlev Oct 24, 2024
1000933
Fix config syntax
RomanIakovlev Oct 24, 2024
da8c336
Merge pull request #608 from clearlydefined/ljones140/update-pipeline…
elrayle Oct 24, 2024
c949ea2
Merge branch 'master' into roman/scancode_parallelism
elrayle Oct 24, 2024
8772e68
Merge pull request #612 from clearlydefined/roman/scancode_parallelism
elrayle Oct 24, 2024
1ae9f4a
update to 3.1.1
ljones140 Oct 25, 2024
3dff4a3
Merge pull request #616 from clearlydefined/update-dev-deploy-3-1-1
elrayle Oct 25, 2024
0deff0c
Set version to v2.0.0 in prep for release
elrayle Oct 25, 2024
284d8f8
Merge pull request #617 from clearlydefined/elr/set-v2.0.0
elrayle Oct 28, 2024
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
36 changes: 36 additions & 0 deletions .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will build a docker image, push it to ghcr.io, and deploy it to an Azure WebApp.
name: Build and Deploy -- DEV

on:
workflow_dispatch:
push:
branches: [master]

jobs:
upload-package-lock-json:
name: Upload package-lock.json from this repo
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Upload package-lock.json
uses: actions/upload-artifact@v4
with:
name: package-lock.json
path: package-lock.json

build-and-deploy:
name: Build and Deploy
needs: upload-package-lock-json
uses: clearlydefined/operations/.github/workflows/[email protected]
secrets:
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_DEV }}
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
PRODUCTION_DEPLOYERS: ${{ secrets.PRODUCTION_DEPLOYERS }}
with:
deploy-env: dev
application-type: worker
azure-app-base-name: cdcrawler
azure-app-name-postfix: -dev
37 changes: 37 additions & 0 deletions .github/workflows/build-and-deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will build a docker image, push it to ghcr.io, and deploy it to an Azure WebApp.
name: Build and Deploy -- PROD

on:
workflow_dispatch:
release:
types: [published]

jobs:
upload-package-lock-json:
name: Upload package-lock.json from this repo
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Upload package-lock.json
uses: actions/upload-artifact@v4
with:
name: package-lock.json
path: package-lock.json

build-and-deploy-prod:
needs: upload-package-lock-json
uses: clearlydefined/operations/.github/workflows/[email protected]
secrets:
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PROD }}
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
PRODUCTION_DEPLOYERS: ${{ secrets.PRODUCTION_DEPLOYERS }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
deploy-env: prod
application-type: worker
azure-app-base-name: cdcrawler
azure-app-name-postfix: -prod
docker-hub-username: ${{ vars.DOCKERHUB_USERNAME }}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github/workflows/*
.vscode/launch.json
schemas/*.json
test/**/*.json
test/**/*.yaml
44 changes: 17 additions & 27 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
"name": "ClearlyDefined",
"program": "${workspaceRoot}/index.js",
"cwd": "${workspaceRoot}",
"runtimeArgs": ["--nolazy"],
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "localhost",
"PORT": "5000"
},
"skipFiles": ["<node_internals>/**/*.js"],
"skipFiles": [
"<node_internals>/**/*.js"
],
"showAsyncStacks": true
},
{
Expand All @@ -28,38 +32,24 @@
"name": "Mocha",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": ["${workspaceRoot}/test/**/*.js", "--timeout", "999999"],
"args": [
"${workspaceRoot}/test/**/*.js",
"--timeout",
"999999"
],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"runtimeArgs": ["--nolazy"],
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "localhost"
},
"console": "internalConsole",
"skipFiles": ["<node_internals>/**/*.js"],
"skipFiles": [
"<node_internals>/**/*.js"
],
"showAsyncStacks": true
},
{
"name": "Coverage",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/istanbul/lib/cli.js",
"stopOnEntry": false,
"args": ["cover", "${workspaceRoot}/node_modules/mocha/bin/_mocha", "${workspaceRoot}/test/unit/**/*.js"],
"cwd": "${workspaceRoot}",
"runtimeExecutable": null,
"runtimeArgs": ["--nolazy"],
"env": {
"NODE_ENV": "localhost"
},
"console": "internalConsole"
},
{
"type": "node",
"request": "launch",
"name": "Launch in WSL",
"useWSL": true,
"program": "${workspaceFolder}/index.js"
}
]
}
32 changes: 18 additions & 14 deletions DevDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,41 @@
FROM node:18-bullseye
ENV APPDIR=/opt/service

# Set environment variables from build arguments
ARG BUILD_NUMBER=0
ENV CRAWLER_BUILD_NUMBER=$BUILD_NUMBER
ENV BUILD_NUMBER=$APP_VERSION
ARG APP_VERSION="UNKNOWN"
ENV APP_VERSION=$APP_VERSION
ARG BUILD_SHA="UNKNOWN"
ENV BUILD_SHA=$BUILD_SHA

# Ruby and Python Dependencies
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests curl bzip2 build-essential libssl-dev libreadline-dev zlib1g-dev cmake python3 python3-dev python3-pip xz-utils libxml2-dev libxslt1-dev libpopt0 && \
rm -rf /var/lib/apt/lists/* && \
curl -L https://github.com/rbenv/ruby-build/archive/v20180822.tar.gz | tar -zxvf - -C /tmp/ && \
curl -L https://github.com/rbenv/ruby-build/archive/refs/tags/v20231012.tar.gz | tar -zxvf - -C /tmp/ && \
cd /tmp/ruby-build-* && ./install.sh && cd / && \
ruby-build -v 2.5.1 /usr/local && rm -rfv /tmp/ruby-build-* && \
gem install bundler -v 2.3.26 --no-document
ruby-build -v 3.2.2 /usr/local && rm -rfv /tmp/ruby-build-* && \
gem install bundler -v 2.5.4 --no-document

# Scancode
ARG SCANCODE_VERSION="30.1.0"
ARG SCANCODE_VERSION="32.1.0"
RUN pip3 install --upgrade pip setuptools wheel && \
curl -Os https://raw.githubusercontent.com/nexB/scancode-toolkit/v$SCANCODE_VERSION/requirements.txt && \
pip3 install --constraint requirements.txt scancode-toolkit==$SCANCODE_VERSION && \
rm requirements.txt && \
scancode --reindex-licenses && \
scancode-reindex-licenses && \
scancode --version

ENV SCANCODE_HOME=/usr/local/bin

# Licensee
# The latest version of nokogiri (1.13.1) and faraday (2.3.0) requires RubyGem 2.6.0 while
# the current RubyGem is 2.5.1. However, after upgrading RubyGem to 3.1.2, licensee:9.12.0 starts
# to have hard time to find license in LICENSE file, like component npm/npmjs/-/caniuse-lite/1.0.30001344.
# So we pin to the previous version of nokogiri and faraday.
RUN gem install nokogiri:1.12.5 --no-document && \
gem install faraday:1.10.0 --no-document && \
gem install public_suffix:4.0.7 --no-document && \
gem install licensee:9.12.0 --no-document
# Licensee and its dependencies pinned to its latest version which helped to update the ruby to its recent version,
# Component npm/npmjs/-/caniuse-lite/1.0.30001344 is getting identified by its correct license but the matcher is dice.
# The match is not an exact match and hence not adopted by CD licensee summarizer.
RUN gem install nokogiri:1.16.0 --no-document && \
gem install faraday:2.9.0 --no-document && \
gem install public_suffix:5.0.4 --no-document && \
gem install licensee:9.16.1 --no-document

# REUSE
RUN pip3 install setuptools
Expand Down
66 changes: 18 additions & 48 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,77 +1,47 @@
# Copyright (c) Microsoft Corporation and others. Licensed under the MIT license.
# SPDX-License-Identifier: MIT

#FROM fossology/fossology:3.4.0 as fossology
#COPY fossology_init.sh fossology_init.sh
#RUN ./fossology_init.sh

FROM node:18-bullseye
ENV APPDIR=/opt/service
#RUN apk update && apk upgrade && \
# apk add --no-cache bash git openssh

ARG BUILD_NUMBER=0
ENV CRAWLER_BUILD_NUMBER=$BUILD_NUMBER
# Set environment variables from build arguments
ARG APP_VERSION="UNKNOWN"
ENV APP_VERSION=$APP_VERSION
ARG BUILD_SHA="UNKNOWN"
ENV BUILD_SHA=$BUILD_SHA

# Ruby and Python Dependencies
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests curl bzip2 build-essential libssl-dev libreadline-dev zlib1g-dev cmake python3 python3-dev python3-pip xz-utils libxml2-dev libxslt1-dev libpopt0 && \
rm -rf /var/lib/apt/lists/* && \
curl -L https://github.com/rbenv/ruby-build/archive/v20180822.tar.gz | tar -zxvf - -C /tmp/ && \
curl -L https://github.com/rbenv/ruby-build/archive/refs/tags/v20231012.tar.gz | tar -zxvf - -C /tmp/ && \
cd /tmp/ruby-build-* && ./install.sh && cd / && \
ruby-build -v 2.5.1 /usr/local && rm -rfv /tmp/ruby-build-* && \
gem install bundler -v 2.3.26 --no-document
ruby-build -v 3.2.2 /usr/local && rm -rfv /tmp/ruby-build-* && \
gem install bundler -v 2.5.4 --no-document

# Scancode
ARG SCANCODE_VERSION="30.1.0"
ARG SCANCODE_VERSION="32.1.0"
RUN pip3 install --upgrade pip setuptools wheel && \
curl -Os https://raw.githubusercontent.com/nexB/scancode-toolkit/v$SCANCODE_VERSION/requirements.txt && \
pip3 install --constraint requirements.txt scancode-toolkit==$SCANCODE_VERSION && \
rm requirements.txt && \
scancode --reindex-licenses && \
scancode-reindex-licenses && \
scancode --version

ENV SCANCODE_HOME=/usr/local/bin

# Licensee
# The latest version of nokogiri (1.13.1) and faraday (2.3.0) requires RubyGem 2.6.0 while
# the current RubyGem is 2.5.1. However, after upgrading RubyGem to 3.1.2, licensee:9.12.0 starts
# to have hard time to find license in LICENSE file, like component npm/npmjs/-/caniuse-lite/1.0.30001344.
# So we pin to the previous version of nokogiri and faraday.
RUN gem install nokogiri:1.12.5 --no-document && \
gem install faraday:1.10.0 --no-document && \
gem install public_suffix:4.0.7 --no-document && \
gem install licensee:9.12.0 --no-document
# Licensee and its dependencies pinned to its latest version which helped to update the ruby to its recent version,
# Component npm/npmjs/-/caniuse-lite/1.0.30001344 is getting identified by its correct license but the matcher is dice.
# The match is not an exact match and hence not adopted by CD licensee summarizer.
RUN gem install nokogiri:1.16.0 --no-document && \
gem install faraday:2.9.0 --no-document && \
gem install public_suffix:5.0.4 --no-document && \
gem install licensee:9.16.1 --no-document

# REUSE
RUN pip3 install setuptools
RUN pip3 install reuse==3.0.1

# FOSSology
# WORKDIR /opt
# RUN git clone https://github.com/fossology/fossology.git
# RUN cd fossology && git checkout -b clearlydefined tags/3.4.0

# See https://github.com/fossology/fossology/blob/faaaeedb9d08f00def00f9b8a68a5cffc5eaa657/utils/fo-installdeps#L103-L105
# Additional libjsoncpp-dev https://github.com/fossology/fossology/blob/261d1a3e663b5fd20652a05b2d6360f4b31a17cb/src/copyright/mod_deps#L79-L80
# RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests \
# libmxml-dev curl libxml2-dev libcunit1-dev libjsoncpp-dev \
# build-essential libtext-template-perl subversion rpm librpm-dev libmagic-dev libglib2.0 libboost-regex-dev libboost-program-options-dev

# WORKDIR /opt/fossology/src/nomos/agent
# RUN make -f Makefile.sa
# RUN echo $(./nomossa -V)

# NOTE: must build copyright before Monk to cause libfossology to be built
# WORKDIR /opt/fossology/src/copyright/agent
# RUN make

# WORKDIR /opt/fossology/src/monk/agent
# RUN make
# RUN echo $(./monk -V)
# COPY --from=fossology /tmp/monk_knowledgebase .

# ENV FOSSOLOGY_HOME=/opt/fossology/src

# Crawler config
ENV CRAWLER_DEADLETTER_PROVIDER=cd(azblob)
ENV CRAWLER_NAME=cdcrawlerprod
Expand All @@ -85,7 +55,7 @@ RUN git config --global --add safe.directory '*'

COPY package*.json /tmp/
COPY patches /tmp/patches
RUN cd /tmp && npm install --production
RUN cd /tmp && npm install --omit=dev
RUN mkdir -p "${APPDIR}" && cp -a /tmp/node_modules "${APPDIR}"

WORKDIR "${APPDIR}"
Expand Down
19 changes: 11 additions & 8 deletions config/cdConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,25 @@ module.exports = {
installDir: config.get('SCANCODE_HOME'),
options: [
'--copyright',
'--license',
'--info',
'--license-text',
'--is-license-text',
'--package',
'--license-text-diagnostics',
'--strip-root',
'--email',
'--url',
'--license-clarity-score',
'--classify',
'--generated',
'--license',
'--license-clarity-score',
'--license-references',
'--license-text',
'--license-text-diagnostics',
'--summary',
'--summary-key-files'
'--tallies',
'--tallies-key-files'
// '--quiet'
],
timeout: 1000,
processes: 2,
processes: Number(config.get('CRAWLER_SCANCODE_PARALLELISM') || process.env.CRAWLER_SCANCODE_PARALLELISM) || 2,
format: '--json-pp'
},
source: {},
Expand Down Expand Up @@ -134,6 +135,8 @@ module.exports = {
attenuation: {
ttl: 3000
}
}
},
appVersion: config.get('APP_VERSION'),
buildsha: config.get('BUILD_SHA')
}
}
4 changes: 1 addition & 3 deletions ghcrawler/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ function configureApp(service, logger) {
app.use('/requests', require('./routes/requests')(service))

// to keep AlwaysOn flooding logs with errors
app.get('/', (request, response) => {
response.helpers.send.noContent()
})
app.use('/', require('./routes/index')(config.get('BUILD_SHA'), config.get('APP_VERSION')))

// Catch 404 and forward to error handler
const requestHandler = (request, response, next) => {
Expand Down
4 changes: 4 additions & 0 deletions ghcrawler/lib/traversalPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ class TraversalPolicy {
return new TraversalPolicy('storageOnly', 'always', TraversalPolicy._resolveMapSpec(map))
}

static reharvestAlways(map) {
return new TraversalPolicy('mutables', 'always', TraversalPolicy._resolveMapSpec(map))
}

static clone(policy) {
return new TraversalPolicy(policy.fetch, policy.freshness, policy.map)
}
Expand Down
20 changes: 20 additions & 0 deletions ghcrawler/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation and others. Licensed under the MIT license.
// SPDX-License-Identifier: MIT
const express = require('express')
const router = express.Router()

router.get('/', function (req, res) {
const msg = `{ "status": "OK", "version": "${version}", "sha": "${sha}" }`
res.status(200).send(msg)
})

module.exports = router

let version
let sha
function setup(buildsha, appVersion) {
version = appVersion
sha = buildsha
return router
}
module.exports = setup
Loading
Loading