Skip to content

Commit e0c38ba

Browse files
authored
Merge branch 'onaio:main' into main
2 parents 563acb8 + f4c4499 commit e0c38ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1482
-410
lines changed

.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ignore everthing
2+
**
3+
# allow the following
4+
!onadata
5+
!requirements
6+
!manage.py
7+
!LICENSE
8+
!pyproject.toml
9+
!setup.cfg
10+
!setup.py
11+
!uwsgi.ini
12+
!extras
13+
!Makefile
14+
!docs
15+
16+
# we finally again ignore the following from the folders allowed above
17+
**/*tests
18+
**/*test
19+
**/*__pycache__

.github/workflows/ci.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: CI
22
on:
3-
- push
4-
- pull_request
3+
pull_request:
4+
branches: ["main"]
5+
push:
6+
branches: ["main"]
57
concurrency:
68
group: ci-${{ github.workflow }}-${{ github.actor }}-${{ github.sha }}
79
cancel-in-progress: true
@@ -21,7 +23,7 @@ jobs:
2123
- name: Setup python
2224
uses: actions/setup-python@v4
2325
with:
24-
python-version: 3.9
26+
python-version: "3.10"
2527
architecture: "x64"
2628
cache: "pip"
2729
cache-dependency-path: |
@@ -38,6 +40,7 @@ jobs:
3840
- name: Install Pip requirements
3941
run: |
4042
pip install -U pip
43+
pip install wheel
4144
pip install -r requirements/base.pip
4245
pip install -r requirements/dev.pip
4346
pip install -r requirements/azure.pip
@@ -82,7 +85,7 @@ jobs:
8285
- name: Setup python
8386
uses: actions/setup-python@v4
8487
with:
85-
python-version: 3.9
88+
python-version: "3.10"
8689
architecture: "x64"
8790
cache: "pip"
8891
cache-dependency-path: |
@@ -139,7 +142,7 @@ jobs:
139142
- name: Setup python
140143
uses: actions/setup-python@v4
141144
with:
142-
python-version: 3.9
145+
python-version: "3.10"
143146
architecture: "x64"
144147
cache: "pip"
145148
cache-dependency-path: |
@@ -181,11 +184,9 @@ jobs:
181184
- name: Build Docker image
182185
uses: docker/build-push-action@v3
183186
with:
184-
context: ./docker/onadata-uwsgi
185-
file: ./docker/onadata-uwsgi/Dockerfile
187+
context: .
188+
file: ./docker/onadata-uwsgi/Dockerfile.ubuntu
186189
platforms: linux/amd64
187-
build-args: |
188-
release_version=${{ github.head_ref || github.base_ref || env.version }}
189190
push: false
190191
tags: |
191192
onaio/onadata:${{ github.head_ref || github.base_ref || env.version }}
@@ -238,7 +239,7 @@ jobs:
238239
echo "SUMMARY=$summary" >> $GITHUB_ENV
239240
240241
- name: Send Slack Notification
241-
uses: slackapi/slack-github-action@v1.19.0
242+
uses: slackapi/slack-github-action@v1.23.0
242243
if: github.event_name == 'push'
243244
with:
244245
payload: |

.github/workflows/docker-image-build.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ on:
88
branches:
99
- "main"
1010
workflow_dispatch:
11-
inputs:
12-
versionTag:
13-
description: "Version Tag"
14-
required: true
15-
default: ''
1611

1712
jobs:
1813
main:
@@ -29,12 +24,12 @@ jobs:
2924

3025
- name: Get the version
3126
id: get-version
32-
if: github.event.inputs.versionTag == '' && github.event_name != 'push'
27+
if: github.event_name != 'push' && github.event_name != 'workflow_dispatch'
3328
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
3429

3530
- name: Get the branch name
3631
id: get-branch-name
37-
if: github.event_name == 'push'
32+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3833
run: echo "version=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
3934

4035
- name: Login to DockerHub
@@ -55,15 +50,14 @@ jobs:
5550
id: docker_build
5651
uses: docker/build-push-action@v2
5752
with:
58-
context: ./docker/onadata-uwsgi
59-
file: ./docker/onadata-uwsgi/Dockerfile
53+
context: .
54+
file: ./docker/onadata-uwsgi/Dockerfile.ubuntu
6055
platforms: linux/amd64,linux/arm64
6156
build-args: |
62-
release_version=${{ github.event.inputs.versionTag || env.version }}
6357
optional_packages=PyYAML django-redis
6458
push: true
6559
tags: |
66-
onaio/onadata:${{ github.event.inputs.versionTag || env.version }}
60+
onaio/onadata:${{ env.version || github.ref_name }}
6761
6862
- name: Image digest
6963
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/ecr-image-build.yml

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,26 @@ on:
77
push:
88
branches:
99
- "main"
10+
- "*-rc"
1011
workflow_dispatch:
11-
inputs:
12-
versionTag:
13-
description: "Version Tag"
14-
required: true
15-
default: ''
12+
buildAlpine:
13+
description: Whether to build an Alpine based image
14+
required: false
15+
type: boolean
16+
default: false
1617

1718
jobs:
1819
build:
19-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-latest
2021
steps:
2122
- name: Checkout
22-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2324

2425
- name: Set up QEMU
25-
uses: docker/setup-qemu-action@v1
26+
uses: docker/setup-qemu-action@v2
2627

2728
- name: Set up Docker Buildx
28-
uses: docker/setup-buildx-action@v1
29-
30-
- name: Get the version
31-
id: get-version
32-
if: github.event.inputs.versionTag == '' && github.event_name != 'push'
33-
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
34-
35-
- name: Get the branch name
36-
id: get-branch-name
37-
if: github.event_name == 'push'
38-
run: echo "version=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
29+
uses: docker/setup-buildx-action@v2
3930

4031
- name: Configure AWS credentials
4132
uses: aws-actions/configure-aws-credentials@v1
@@ -57,29 +48,62 @@ jobs:
5748
mkdir -p ~/.ssh
5849
ssh-keyscan github.com > ~/.ssh/known_hosts
5950
60-
- name: Build and push
61-
id: docker-build
51+
- name: Get the version
52+
id: get-version
53+
if: github.event_name != 'push'
54+
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
55+
56+
- name: Get the branch name
57+
id: get-branch-name
58+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
59+
run: echo "version=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
60+
61+
- name: (Ubuntu) Build and push
62+
id: docker-build-ubuntu
6263
uses: docker/build-push-action@v2
6364
with:
64-
context: ./docker/onadata-uwsgi
65-
file: ./docker/onadata-uwsgi/Dockerfile
65+
context: .
66+
file: ./docker/onadata-uwsgi/Dockerfile.ubuntu
6667
platforms: linux/amd64
68+
cache-from: type=registry,ref=${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ env.version }}
69+
cache-to: type=inline
6770
ssh: |
6871
default=/tmp/ssh-agent.sock
6972
build-args: |
70-
release_version=${{ github.event.inputs.versionTag || env.version }}
7173
optional_packages=PyYAML django-redis ${{ secrets.ECR_OPTIONAL_PACKAGES }}
7274
push: true
7375
tags: |
74-
${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ github.event.inputs.versionTag || env.version }}
76+
${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ env.version || github.ref_name }}
77+
78+
- name: (Alpine) Build and push
79+
id: docker-build-alpine
80+
uses: docker/build-push-action@v2
81+
if: github.event.inputs.buildAlpine
82+
with:
83+
context: .
84+
file: ./docker/onadata-uwsgi/Dockerfile.alpine
85+
platforms: linux/amd64
86+
cache-from: type=registry,ref=${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ env.version }}
87+
cache-to: type=inline
88+
ssh: |
89+
default=/tmp/ssh-agent.sock
90+
build-args: |
91+
optional_packages=PyYAML django-redis ${{ secrets.ECR_OPTIONAL_PACKAGES }}
92+
push: true
93+
tags: |
94+
${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ env.version || github.ref_name }}-alpine
95+
96+
- name: (Ubuntu) Image digest
97+
run: echo ${{ steps.docker-build-ubuntu.outputs.digest }}
7598

76-
- name: Image digest
77-
run: echo ${{ steps.docker-build.outputs.digest }}
99+
- name: (Alpine) Image digest
100+
if: github.event.inputs.buildAlpine
101+
run: echo ${{ steps.docker-build-alpine.outputs.digest }}
78102

79103
- name: Run Trivy vulnerability scanner
80104
uses: aquasecurity/trivy-action@master
81105
with:
82-
image-ref: ${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ github.event.inputs.versionTag || env.version }}
106+
image-ref: ${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ env.version || github.ref_name }}
83107
format: 'sarif'
84108
output: 'trivy-results.sarif'
85109

@@ -91,7 +115,7 @@ jobs:
91115
- name: Run Trivy vulnerability scanner for Slack
92116
uses: aquasecurity/trivy-action@master
93117
with:
94-
image-ref: ${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ github.event.inputs.versionTag || env.version }}
118+
image-ref: ${{ steps.login-ecr.outputs.registry }}/onaio/onadata:${{ env.version || github.ref_name }}
95119
format: json
96120
output: 'trivy-results.json'
97121

@@ -105,11 +129,11 @@ jobs:
105129
echo "SUMMARY=$summary" >> $GITHUB_ENV
106130
107131
- name: Send Slack Notification
108-
uses: slackapi/slack-github-action@v1.19.0
132+
uses: slackapi/slack-github-action@v1.23.0
109133
with:
110134
payload: |
111135
{
112-
"text": "Trivy scan results for ${{ github.event.inputs.versionTag || steps.get-version-release.outputs.VERSION || github.base_ref }}",
136+
"text": "Trivy scan results for ${{ env.version || github.ref_name }}",
113137
"blocks": [
114138
{
115139
"type": "section",
@@ -122,7 +146,7 @@ jobs:
122146
"type": "section",
123147
"text": {
124148
"type": "mrkdwn",
125-
"text": "View scan results: https://github.com/${{ github.repository }}/security."
149+
"text": "View scan results: https://github.com/${{ github.repository }}/security/code-scanning?query=branch:${{ env.version || github.ref_name }}+is:open++"
126150
}
127151
}
128152
]

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ignore-patterns=
1515

1616
# Python code to execute, usually for sys.path manipulation such as
1717
# pygtk.require().
18-
#init-hook=
18+
init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.dirname(find_pylintrc()))"
1919

2020
# Use multiple processes to speed up Pylint.
2121
jobs=1

CHANGES.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,55 @@ Changelog for Onadata
33

44
``* represents releases that introduce new migrations``
55

6+
v3.9.0(2023-05-02)
7+
-----------------
8+
9+
- Add azure token to media files urls
10+
`PR #2388 <https://github.com/onaio/onadata/pull/2388>`
11+
[@ciremusyoka]
12+
- Pass user-provided values as parameters
13+
`PR #2394 <https://github.com/onaio/onadata/pull/2394>`
14+
[@KipSigei]
15+
- Handle scenario where an inactive user is part of an Organization
16+
`PR #2374 <https://github.com/onaio/onadata/pull/2374>`
17+
[@DavisRayM]
18+
- Dependabot updates
19+
`PR #2397 <https://github.com/onaio/onadata/pull/2397>`
20+
[@KipSigei]
21+
- Allow authenticated users to download public form exports
22+
`PR #2396 <https://github.com/onaio/onadata/pull/2396>`
23+
[@ciremusyoka]
24+
- Update savreaderwriter version
25+
`PR #2399 <https://github.com/onaio/onadata/pull/2399>`
26+
[@DavisRayM]
27+
- ignore .python-version
28+
`PR #2402 <https://github.com/onaio/onadata/pull/2402>`
29+
[@kelvin-muchiri]
30+
- fix bug NoneType object has no attribute push
31+
`PR #2403 <https://github.com/onaio/onadata/pull/2403>`
32+
[@kelvin-muchiri]
33+
- Fix IndexError exception raised when comparing functions
34+
`PR #2408 <https://github.com/onaio/onadata/pull/2403>`
35+
[@DavisRayM]
36+
- Bump base image
37+
[@DavisRayM]
38+
`PR #2409 <https://github.com/onaio/onadata/pull/2409>`
39+
- Add statistics endpoint for actstream actions
40+
`PR #2390 <https://github.com/onaio/onadata/pull/2390>`
41+
[@DavisRayM]
42+
- Prevent numeric usernames on user creation
43+
[@KipSigei]
44+
`PR #2407 <https://github.com/onaio/onadata/pull/2407>`
45+
- Assign default team project role to users
46+
`PR #2401 <https://github.com/onaio/onadata/pull/2401>`
47+
[@DavisRayM]
48+
- [SAV Exports] Ensure duplicate metadata fields are handled accordingly
49+
`PR #2412 <https://github.com/onaio/onadata/pull/2412>`
50+
[@DavisRayM]
51+
- Strengthen password standards for users
52+
`PR #2414 <https://github.com/onaio/onadata/pull/2414>`
53+
[@DavisRayM]
54+
655
v3.8.6(2023-03-07)
756
------------------
857
- Handle cases of duplicate metadata fields within exports

0 commit comments

Comments
 (0)