Commit graph

42 commits

Author SHA1 Message Date
Ryan Lee
88287d4eec Update .gitlab-ci.yml file with -j $(nproc) lines for faster building
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
2024-10-18 11:45:38 -07:00
John Johansen
bb460ba467 Merge .gitlab-ci.yml: run pipeline in merge requests too
Hopefully this will allow us to run pipelines in regular branches but
also run it on merge requests on the parent project. This is needed
for users that are not verified by Gitlab.
https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#run-pipelines-in-the-parent-project

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1346
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-10-04 21:31:51 +00:00
Georgia Garcia
c382efe119 gitlab-ci.yml: only run coverity in the upstream project
This pipeline only makes sense to run in the upstream project where
the coverity variables are defined, so they currently fail in forks.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-10-03 11:12:36 -03:00
Georgia Garcia
248e5673ef .gitlab-ci.yml: run pipeline in merge requests too
Hopefully this will allow us to run pipelines in regular branches but
also run it on merge requests on the parent project. This is needed
for users that are not verified by Gitlab.
https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#run-pipelines-in-the-parent-project
2024-10-02 17:37:27 -03:00
Maxime Bélair
ff1baf3851 aa-notify: Enhanced Graphical User Interfaces 2024-08-13 16:58:25 +00:00
John Johansen
b460539eeb Merge profiles/Makefile: Clean up rules to better support extra profiles
In the course of preparing !1207, I found that the validation rules in `profiles/Makefile` did not take kindly to the new `profiles/apparmor/profiles/extras/abstractions/` directory. I tried a couple rounds of quick fixes, but it became clear that the rules as currently written were just not amenable to the new addition, and needed more attention than I could give it by-the-by.

So I separated out that commit, and revised the makefile more thoroughly. The updated rules now rely more on `find(1)` than `$(wildcard)`, and have a number of [what I believe to be] small quality-of-life improvements. Taken together, `make check` passes cleanly with the new files from my other MR present.

One thing I noticed was that the profiles under `apparmor.d/` were not previously being checked for the `include if exists <local/*>` bit---only the ones under `extras/`. I've thus included a fix to the `sbuild-shell` profile, which fortunately was the only one that failed the check.

Note that at present, you'll get a couple of harmless `find: ‘./apparmor/profiles/extras/abstractions’: No such file or directory` errors when running the checks, since that directory won't appear until the other MR is merged. I figure, better to bear that for now, and not have to touch the makefile again later.

NOTE: The CI pipeline here will need to be updated to invoke the `check-local` target instead of `check-extras`. This target was renamed as it is no longer limited in scope to the profiles under `extras/`.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1214
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
2024-05-30 19:12:31 +00:00
Georgia Garcia
e511b05c59 utils: switch pyflakes3 to flake8 to improve python checks
The following exceptions were added to flake8 since they have several
expected uses in the tools and their tests:

E501: Line lengths are recommended to be no greater than 79 characters.
E241: Multiple spaces after ','
W503: Line break occurred before a binary operator

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-05-20 13:56:37 -03:00
Georgia Garcia
731880def8 gitlab-ci.yml: fix pipeline for ubuntu:latest (noble)
Since we are using ubuntu:latest, and noble was released, some tests
are failing.

shellcheck needs python3 to run, which was possibly installed by
default in previous ubuntu images and is no longer the case.

Ignore dist-packages python files during our coverage tests.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/388

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2024-04-30 17:58:21 -03:00
Daniel Richard G
e4a395b620 profiles/Makefile: Clean up rules to better support extra profiles
Rename the "check-extras" target to "check-local" as it is no longer
limited to the extra profiles, and also fix a local include in the
sbuild-shell profile so that it passes the newly-applied CI check.
2024-04-16 01:57:16 -04:00
Félix Poisot
420d3395fc makefiles: test for support of flto-partition flag
Test for compiler support of "-flto-partition=none" flag before passing
it.

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/310
2024-02-24 16:07:55 +00:00
Christian Boltz
34a46bd8f2
Enable coverity scans for master
... so that each change in master gets scanned (until we reach the scan
limit).

This will give us more timely results than only scanning the coverity
branch whenever someone manually updates it.
2023-06-13 20:35:07 +02:00
Christian Boltz
3ddb1677dd
CI: check extra profiles for local/ includes 2023-04-18 22:43:00 +02:00
Georgia Garcia
ae347d07fb .gitlab-ci.yml: add support to run coverity
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
2023-03-27 10:40:30 -03:00
Ben Greiner
85734c3bac add setuptools to test-utils CI job 2022-07-16 20:42:07 +02:00
John Johansen
51615755f8 Revert "gitlab: testing: temporarily disable secret-detect"
This reverts commit 8b4344c17b.
2022-02-21 11:31:44 -08:00
John Johansen
8b4344c17b gitlab: testing: temporarily disable secret-detect
Unfortunately secret detection is failing with
   fatal: error in object: unshallow sha1

and blocking merge requests. Unfortuntely all suggested work arounds
from https://gitlab.com/gitlab-org/gitlab/-/issues/351976 failed to
work.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2022-02-18 00:19:31 -08:00
intrigeri
8c8965a720 CI: don't run the Bandit SAST analyzer on our test suites
Let's focus for now on code that runs on our users' systems.
2022-02-13 21:05:54 +00:00
intrigeri
086fb04f21 CI: disable SemGrep SAST analyzer
It runs the flawfinder checks, so let's disable this one for the same reason
we disabled flawfinder.
2022-02-13 21:05:54 +00:00
intrigeri
9bbbcd8447 CI: disable ESLint SAST analyzer
We have no JavaScript code, let's make the GitLab CI user interface leaner.
2022-02-13 21:05:54 +00:00
intrigeri
8655cf162a CI: disable flawfinder SAST analyzer
It reports hundreds of issues, lots of them with critical severity.
The GitLab UI allows dismissing them one-by-one very quickly,
but I'm not a good person to do that.
Let's try to have a better signal/noise ratio for this first iteration.
2022-02-13 21:05:54 +00:00
intrigeri
9240e12e73 CI: disable Dependency Scanning
According to
https://docs.gitlab.com/ee/user/application_security/dependency_scanning/,
"dependency scanning lets you know if your application uses an external (open
source) library that is known to be vulnerable".

AppArmor is not the kind of project that benefits from it: we don't link
statically against our dependencies, nor bundle them into released
artifacts.
2022-02-13 21:05:54 +00:00
intrigeri
7d69e55074 CI: disable spotbugs SAST analyzer
It requires building our Ant projects, which have not been touched in years.
2022-02-13 21:05:54 +00:00
intrigeri
9f8c0d25e3 CI: only run Debian'ish commands on jobs run on Debian'ish systems 2022-02-13 21:05:52 +00:00
Eric Rosenberg
2a7bd3aa9e CI: enable SAST, Secret-Detection, and Dependency Scanning 2022-02-13 21:04:18 +00:00
intrigeri
099f99a395 CI: ensure test-utils runs all intended tests 2022-02-13 21:02:58 +00:00
intrigeri
f0ff344e2a CI: normalize indentation 2022-02-13 21:02:58 +00:00
intrigeri
694b3348da CI: parallelize across multiple jobs, only install necessary dependencies 2022-02-13 21:02:56 +00:00
intrigeri
3c1163825b CI: don't install unneeded python-all-dev (Python 2) 2022-02-13 21:01:24 +00:00
intrigeri
529d386775 CI: enable all shellcheck severity levels
The few previous commits make this pass, let's profit.
2022-02-13 19:43:48 +00:00
intrigeri
985f9ca788 CI: set shellcheck minimum severity to info
The few previous commits make this pass, let's profit.
2022-02-13 19:43:48 +00:00
intrigeri
e55a9b3735 CI: set shellcheck minimum severity to warning
The few previous commits make this pass, let's profit.
2022-02-13 19:43:48 +00:00
intrigeri
5a6f6c2fc8 CI: add shellcheck job, with minimum severity set to error
We have way too many warnings to enable lower severity levels,
but let's at least we don't introduce new errors.
2022-02-13 19:43:48 +00:00
Georgia Garcia
21e5a721ab replace deprecated distutils with setuptools
Adds python3 setuptools as a build dependency for libapparmor

Fixes: https://gitlab.com/apparmor/apparmor/-/issues/202
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/813
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2021-11-11 20:23:35 -03:00
Christian Boltz
266ac13e10
CI: always collect test artifacts
The default is to collect them on success, but that's not helpful to
debug failure cases.
2021-08-15 16:28:35 +02:00
Christian Boltz
8d9e2489a2
Generate and keep html in utils coverage-regression
We sometimes have random coverage changes that are not reproducible and
therefore hard to debug.

Generate html coverage as part of make coverage-regression, and keep the
resulting utils/test/htmlcov/ as artifact to make debugging easier.

coverage-html needs JS files from various libjs-* packages, install them
in before_script
2021-07-13 18:40:59 +02:00
Christian Boltz
e38be7b14f
enable utils coverage-regression checks in CI
This also needs installing python3-coverage in the test environment.
2021-01-11 13:51:54 +01:00
Christian Boltz
2c5d3cb381
CI: Drop specifying python and pyflakes version
Since https://gitlab.com/apparmor/apparmor/-/merge_requests/482
python 3.x will be used by default (as the only python version),
which makes it superfluous to explicitely specify it.
2020-04-20 13:28:09 +02:00
Christian Boltz
07a15d651a
run "make -C profiles check-abstractions.d" in ci
... to make sure we notice missing
    #include if exists <$abstraction_name.d/>
2020-01-27 20:43:55 +01:00
Christian Boltz
b3020dfaf5
CI: cat config.log if libapparmor configure fails
This helped a lot to debug the CI failure caused by
3db14e8e49 / !430, and won't add any noise
as long as configure succeeds.
2019-11-27 21:09:32 +01:00
Christian Boltz
6c85836be5
add zlib1g-dev to .gitlab-ci.yml
This fixes the CI failures introduced with
3db14e8e49 - either conf('BLDLIBRARY') or
$PYTHON_EXTRA_LIBS introduce a dependency on zlib-dev ("-lz").
2019-11-19 22:52:22 +01:00
Otto Kekäläinen
a74d7cf51c Re-implement aa-notify in Python (Closes: #16)
- Code layout based on aa-genprof example
- Extend Python dependencies to cover new need by aa-notify
- Update documentation after aa-notify is no longer in Perl
2019-04-21 18:37:10 +03:00
Steve Beattie
ab94074887
misc: add initial gitlab-ci.yml for running build/tests
This commit adds an initial gitlab-ci.yml file to perform test builds
and run tests on each commit.

v2: add liblocale-gettext-perl dependency for parser simple test
v3:
  - set noninteractive prompt to avoid debconf queries when installing
    packages
  - disable profiles test against aa-logprof; even if library and python
    path issues are resolved, aa-logprof early aborts due to being
    unable to find /sbin/apparmor_parser

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: Tyler Hicks <tyler.hicks@canonical.com>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/101
2018-05-11 19:02:36 -07:00