Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
20318c4
add codeql and dependabot
Xiangs18 Apr 28, 2025
d757a40
add standard workflows
Xiangs18 Apr 29, 2025
c77e348
update test.yml file
Xiangs18 Apr 29, 2025
586e111
update python version in pyproject.toml and update lock file
Xiangs18 Apr 30, 2025
cb38726
add --no-root flag to fix package issue
Xiangs18 Apr 30, 2025
4c7540e
update dockerfile
Xiangs18 Apr 30, 2025
860cede
fix docker build error
Xiangs18 Apr 30, 2025
60c19df
switch back to jsonrpcbase
Xiangs18 Apr 30, 2025
268545f
copy jsonrpc11base over
Xiangs18 Apr 30, 2025
36047d6
revert previous jsonrpc changes
Xiangs18 Apr 30, 2025
c2d35ba
comment mypy
Xiangs18 Apr 30, 2025
48a2198
copy over jsonrpcbase
Xiangs18 May 1, 2025
3233636
remove jsonrpcbase dep
Xiangs18 May 1, 2025
392362a
update pytest, pytest-cov dep
Xiangs18 May 2, 2025
5be7663
update test.yml
Xiangs18 May 2, 2025
87f6454
update requests dep
Xiangs18 May 2, 2025
2ad4f69
add debug for failed test
Xiangs18 May 5, 2025
fc9a2b3
make pytest fail early
Xiangs18 May 5, 2025
b127c62
use docker compose
Xiangs18 May 5, 2025
d513b80
get all tests running fast
Xiangs18 May 6, 2025
e0bcc93
fix unit tests
Xiangs18 May 6, 2025
f1159c9
remove coverage dep
Xiangs18 May 6, 2025
572cdbc
fix container cannot stop issue
Xiangs18 May 13, 2025
a899501
update docker-compose file
Xiangs18 May 13, 2025
40d548e
fix failed tests
Xiangs18 May 13, 2025
2054361
update integration-testing.md
Xiangs18 May 13, 2025
4fd352a
add readme file for vendored repo
Xiangs18 May 13, 2025
82bd335
fix and test containers are correctly shutting downs in both unit and…
Xiangs18 May 15, 2025
dcd0381
extend stop_timeout
Xiangs18 May 15, 2025
8561fe2
add timeout flag
Xiangs18 May 15, 2025
4044d9e
remove version from docker-compose file and revert back to logger.war…
Xiangs18 May 15, 2025
cccb89b
use kbase-jsonrpcbase 0.3.0a6 and update readme.md file
Xiangs18 May 16, 2025
542b9dc
update changelog
Xiangs18 May 16, 2025
623dad4
update jsonrpc readme.md file
Xiangs18 May 16, 2025
8cf55e5
clean up stop_serivce function
Xiangs18 May 17, 2025
efa12c8
remove unused dep
Xiangs18 May 17, 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
52 changes: 52 additions & 0 deletions .github/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Code scanning - action"

on:
push:
pull_request:
schedule:
- cron: '0 19 * * 0'

jobs:
CodeQL-Build:

# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
updates:

# Docker
- package-ecosystem: docker
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 25

# Python
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
open-pull-requests-limit: 25

# GitHub Actions
- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: "monthly"
open-pull-requests-limit: 25
69 changes: 0 additions & 69 deletions .github/workflows/build-test-push.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Pull Request Build, Tag, & Push
on:
pull_request:
branches:
- develop
- main
- master
types:
- opened
- reopened
- synchronize
- closed
jobs:
build-develop-open:
if: github.base_ref == 'develop' && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build.yml@main
secrets: inherit
build-develop-merge:
Comment on lines +16 to +19

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
if: github.base_ref == 'develop' && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: pr-${{ github.event.number }},latest
secrets: inherit
build-main-open:
Comment on lines +20 to +26

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }}
secrets: inherit
build-main-merge:
Comment on lines +27 to +33

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }},latest-rc
secrets: inherit
trivy-scans:
Comment on lines +34 to +40

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
secrets: inherit
Comment on lines +41 to +43

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
25 changes: 25 additions & 0 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Release - Build & Push Image
on:
release:
branches:
- main
- master
types: [ published ]
jobs:
check-source-branch:
uses: kbase/.github/.github/workflows/reusable_validate-branch.yml@main
with:
build_branch: '${{ github.event.release.target_commitish }}'
validate-release-tag:
Comment on lines +11 to +14

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
needs: check-source-branch
uses: kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main
with:
release_tag: '${{ github.event.release.tag_name }}'
build-push:
Comment on lines +15 to +19

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
needs: validate-release-tag
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: '${{ github.event.release.tag_name }},latest'
secrets: inherit
Comment on lines +20 to +25

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Original file line number Diff line number Diff line change
@@ -1,35 +1,50 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Run tests
name: Run search_api2 tests

on:
pull_request:
branches: [ "*" ]
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Check out GitHub repo
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: 3.9.19

- name: Pip installation
run: python -m pip install --upgrade pip poetry

- name: Poetry installation
run: poetry install
run: poetry install --no-root

- name: Create test image
run: docker-compose build
run: docker compose build

- name: Run tests
run: scripts/run_tests
- name: Codecov
uses: codecov/codecov-action@v1

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Standard GitHub Actions workflows

### Changed
- Upgraded Python to version 3.9.19 in test workflows and Dockerfile
- Updated integration tests README file

### Fixed
- Container/service shutdown issues; all unit and integration tests now pass locally

### Security
- Vendored `kbase-jsonrpcbase` 0.3.0a6 and `jsonrpc11base` to resolve dependency conflicts

## [1.0.0] - 2021-04-20
### Fixed
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM python:3.7-alpine
FROM python:3.9.19-alpine

# Dockerize related args
ARG BUILD_DATE
ARG VCS_REF
ARG BRANCH=develop
ENV DOCKERIZE_VERSION v0.6.1

Check warning on line 7 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-develop-open / build-image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 7 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-develop-merge / build-push-image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# Install dockerize
RUN apk --update add --no-cache --virtual build-dependencies curl tar gzip && \
Expand All @@ -27,9 +27,9 @@
# Install dependencies
COPY pyproject.toml poetry.lock /app/
RUN apk --update add --no-cache --virtual build-dependencies libffi-dev libressl-dev musl-dev python3-dev build-base git rust cargo && \
pip install --upgrade pip poetry==1.0.9 && \
pip install --upgrade pip poetry==2.1.2 && \
poetry config virtualenvs.create false && \
poetry install --no-dev --no-interaction --no-ansi && \
poetry install --no-root --without dev --no-interaction --no-ansi && \
apk del --no-cache build-dependencies

COPY . /app
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

# This docker-compose is for developer convenience, not for running in production.

services:
Expand Down
Loading
Loading