Merge pull request #2910 from coolo/add_editorconfig_check
Validate that the files match the editor config
This commit is contained in:
commit
b4e25496e4
14
.ecrc
Normal file
14
.ecrc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"Verbose": false,
|
||||||
|
"IgnoreDefaults": false,
|
||||||
|
"Exclude": ["tests/fixtures", "LICENSE", "\\.py$", "bs_copy"],
|
||||||
|
"SpacesAfterTabs": true,
|
||||||
|
"Disable": {
|
||||||
|
"EndOfLine": false,
|
||||||
|
"Indentation": false,
|
||||||
|
"IndentSize": false,
|
||||||
|
"InsertFinalNewline": false,
|
||||||
|
"TrimTrailingWhitespace": false,
|
||||||
|
"MaxLineLength": false
|
||||||
|
}
|
||||||
|
}
|
@ -27,3 +27,18 @@ indent_style = tab
|
|||||||
[**.{pl,py}]
|
[**.{pl,py}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
|
[staging_templates/create_new_staging]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[publish_distro_conf/*.config]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[osc-staging-workflow.dot]
|
||||||
|
indent_size = 3
|
||||||
|
|
||||||
|
[factory-package-news/rsyslog/factory-package-news.conf]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[data/repos.json]
|
||||||
|
indent_size = 3
|
||||||
|
14
.github/workflows/editorconfig-check.yml
vendored
Normal file
14
.github/workflows/editorconfig-check.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name: EditorConfig Checker
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
editorconfig:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: editorconfig-checker/action-editorconfig-checker@main
|
||||||
|
- run: editorconfig-checker
|
@ -15,7 +15,10 @@
|
|||||||
"DISTRI": "opensuse",
|
"DISTRI": "opensuse",
|
||||||
"FLAVOR": "DVD-Incidents",
|
"FLAVOR": "DVD-Incidents",
|
||||||
"VERSION": "15.4",
|
"VERSION": "15.4",
|
||||||
"ARCH": ["x86_64", "aarch64"]
|
"ARCH": [
|
||||||
|
"x86_64",
|
||||||
|
"aarch64"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"openSUSE:Backports:SLE-15-SP4:Update": {
|
"openSUSE:Backports:SLE-15-SP4:Update": {
|
||||||
"DISTRI": "opensuse",
|
"DISTRI": "opensuse",
|
||||||
|
@ -12,45 +12,52 @@ The generated release spec files are split into 000release-packages to avoid nee
|
|||||||
The package list generator reads several files. The most important are group*.yml (traditionally only groups.yml) within 000package-groups.
|
The package list generator reads several files. The most important are group*.yml (traditionally only groups.yml) within 000package-groups.
|
||||||
|
|
||||||
### supportstatus.txt
|
### supportstatus.txt
|
||||||
|
|
||||||
The file lists the packages and their support level. It's only necessary to list packages here that have a different level than the default level specificied in the groups. The format is plain text: <package name> <level> - the level is handed over 1:1 to KIWI file. Currently used values are: unsupported, l2 and l3
|
The file lists the packages and their support level. It's only necessary to list packages here that have a different level than the default level specificied in the groups. The format is plain text: <package name> <level> - the level is handed over 1:1 to KIWI file. Currently used values are: unsupported, l2 and l3
|
||||||
|
|
||||||
### group*.yml
|
### group*.yml
|
||||||
|
|
||||||
The file is a list of package lists and the special hash 'OUTPUT'. OUTPUT contains an entry for every group file that needs to be written out. The group name of it needs to exist as package list as well. OUTPUT also contains flags for the groups.
|
The file is a list of package lists and the special hash 'OUTPUT'. OUTPUT contains an entry for every group file that needs to be written out. The group name of it needs to exist as package list as well. OUTPUT also contains flags for the groups.
|
||||||
|
|
||||||
We currently support:
|
We currently support:
|
||||||
* default-support
|
|
||||||
|
* **default-support**
|
||||||
Sets the support level in case there is no explicitly entry in [supportstatus.txt](#supportstatustxt), defaults to 'unsupported'
|
Sets the support level in case there is no explicitly entry in [supportstatus.txt](#supportstatustxt), defaults to 'unsupported'
|
||||||
* recommends
|
|
||||||
|
* **recommends**
|
||||||
If the solver should take recommends into account when solving the package list, defaults to false.
|
If the solver should take recommends into account when solving the package list, defaults to false.
|
||||||
* includes
|
|
||||||
|
* **includes**
|
||||||
Adds package lists to the group to be solved. Allows to organize different topics into the same group. By default there are no package lists added - the package list with the group name is always there.
|
Adds package lists to the group to be solved. Allows to organize different topics into the same group. By default there are no package lists added - the package list with the group name is always there.
|
||||||
* excludes
|
|
||||||
|
* **excludes**
|
||||||
Removes all packages from the __solved__ groups listed. Used to build addons to main products.
|
Removes all packages from the __solved__ groups listed. Used to build addons to main products.
|
||||||
* conflicts
|
|
||||||
|
* **conflicts**
|
||||||
Sets package groups not to be part of the same product. Influences the [overlap calculation](#overlap-calculation) only.
|
Sets package groups not to be part of the same product. Influences the [overlap calculation](#overlap-calculation) only.
|
||||||
|
|
||||||
Be aware that group names must not contain a '-'.
|
Be aware that group names must not contain a '-'.
|
||||||
|
|
||||||
You can also adapt the solving on a package level by putting a hash into the package list. Normally the package name is a string, in case it's a hash the key needs to be the package name and the value is a list of following modifiers:
|
You can also adapt the solving on a package level by putting a hash into the package list. Normally the package name is a string, in case it's a hash the key needs to be the package name and the value is a list of following modifiers:
|
||||||
|
|
||||||
* recommended
|
* **recommended**
|
||||||
Evaluate also 'Recommends' in package to determine dependencies. Otherwise only 'required' are considered. Used mainly for patterns in SLE. It can not be combined with platforms, For architecture specific recommends, use patterns.
|
Evaluate also 'Recommends' in package to determine dependencies. Otherwise only 'required' are considered. Used mainly for patterns in SLE. It can not be combined with platforms, For architecture specific recommends, use patterns.
|
||||||
* suggested
|
* **suggested**
|
||||||
Evaluate also 'Suggests' in package to determine dependencies. This implies recommended
|
Evaluate also 'Suggests' in package to determine dependencies. This implies recommended
|
||||||
* architecture (e.g. x86_64,s390x,ppc64le,aarch64)
|
* **architecture (e.g. x86_64,s390x,ppc64le,aarch64)**
|
||||||
Makes the entry specific to the listed architectures. Will get ignored if used in combination with 'recommended'.
|
Makes the entry specific to the listed architectures. Will get ignored if used in combination with 'recommended'.
|
||||||
* locked
|
* **locked**
|
||||||
Do not put the package into this group. Used to *force* certain packages into other modules
|
Do not put the package into this group. Used to *force* certain packages into other modules
|
||||||
* silent
|
* **silent**
|
||||||
Use this package for dependency solving of groups "on top", but do not output the package for this group. Mainly to mark the product to use by adding release packages. Use with care, this breaks dependency chains!
|
Use this package for dependency solving of groups "on top", but do not output the package for this group. Mainly to mark the product to use by adding release packages. Use with care, this breaks dependency chains!
|
||||||
* required
|
* **required**
|
||||||
If the package is missing or is uninstallable, don't leave a comment but put the error as package entry for OBS to create unresolvable error to avoid building a DVD
|
If the package is missing or is uninstallable, don't leave a comment but put the error as package entry for OBS to create unresolvable error to avoid building a DVD
|
||||||
|
|
||||||
Note that you can write yaml lists in 2 ways. You can put the modifier lists as multiple lines starting with -, but it's recommended to put them as [M1,M2] behind the package name. See the difference between pkg4 and pkg5 in the example.
|
Note that you can write yaml lists in 2 ways. You can put the modifier lists as multiple lines starting with -, but it's recommended to put them as [M1,M2] behind the package name. See the difference between pkg4 and pkg5 in the example.
|
||||||
|
|
||||||
#### Example:
|
#### Example
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
- group1:
|
- group1:
|
||||||
includes:
|
includes:
|
||||||
@ -88,9 +95,11 @@ list2:
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Overlap calculation
|
## Overlap calculation
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
|
||||||
## Handling in staging workflow
|
## Handling in staging workflow
|
||||||
|
|
||||||
If 000package-groups contains a file named summary-staging.txt, the bot will trigger a diff mode on staging projects.
|
If 000package-groups contains a file named summary-staging.txt, the bot will trigger a diff mode on staging projects.
|
||||||
It will create an equal summary-staging.txt in 000product and create a comment with a human readable diff in the staging
|
It will create an equal summary-staging.txt in 000product and create a comment with a human readable diff in the staging
|
||||||
project. This comment can be replied to. If the reply starts with 'approve', staging accept will apply the diff to this
|
project. This comment can be replied to. If the reply starts with 'approve', staging accept will apply the diff to this
|
||||||
|
@ -69,9 +69,7 @@ pipelines:
|
|||||||
resources:
|
resources:
|
||||||
- repo-checker
|
- repo-checker
|
||||||
tasks:
|
tasks:
|
||||||
- script: |-
|
- script: ./scripts/staging-installcheck.py -A $STAGING_API -p SUSE:SLE-15-SP4:Update:Products:Micro54 -s $STAGING_PROJECT
|
||||||
./scripts/staging-installcheck.py -A $STAGING_API -p SUSE:SLE-15-SP4:Update:Products:Micro54 -s $STAGING_PROJECT
|
|
||||||
|
|
||||||
- Update.000product:
|
- Update.000product:
|
||||||
resources:
|
resources:
|
||||||
- repo-checker
|
- repo-checker
|
||||||
@ -132,9 +130,7 @@ pipelines:
|
|||||||
resources:
|
resources:
|
||||||
- repo-checker
|
- repo-checker
|
||||||
tasks:
|
tasks:
|
||||||
- script: |-
|
- script: ./scripts/staging-installcheck.py -A $STAGING_API -p SUSE:SLE-15-SP4:Update:Products:Micro54 -s $STAGING_PROJECT
|
||||||
./scripts/staging-installcheck.py -A $STAGING_API -p SUSE:SLE-15-SP4:Update:Products:Micro54 -s $STAGING_PROJECT
|
|
||||||
|
|
||||||
- Update.000product:
|
- Update.000product:
|
||||||
resources:
|
resources:
|
||||||
- repo-checker
|
- repo-checker
|
||||||
|
@ -65,9 +65,7 @@ pipelines:
|
|||||||
resources:
|
resources:
|
||||||
- repo-checker
|
- repo-checker
|
||||||
tasks:
|
tasks:
|
||||||
- script: |-
|
- script: ./scripts/staging-installcheck.py -A $STAGING_API -p SUSE:SLE-15-SP4:Update:Products:Micro54 -s $STAGING_PROJECT
|
||||||
./scripts/staging-installcheck.py -A $STAGING_API -p SUSE:SLE-15-SP4:Update:Products:Micro54 -s $STAGING_PROJECT
|
|
||||||
|
|
||||||
- Update.000product:
|
- Update.000product:
|
||||||
resources:
|
resources:
|
||||||
- repo-checker
|
- repo-checker
|
||||||
|
@ -31,4 +31,4 @@ pipelines:
|
|||||||
- staging-bot
|
- staging-bot
|
||||||
tasks:
|
tasks:
|
||||||
- script: |
|
- script: |
|
||||||
ruby obs-to-vagrantcloud.rb --url <%= url %> --organization opensuse --new-box-name <%= box_name %><% end -%>
|
ruby obs-to-vagrantcloud.rb --url <%= url %> --organization opensuse --new-box-name <%= box_name %><% end %>
|
||||||
|
@ -291,7 +291,7 @@ def walk_points(points, target):
|
|||||||
final = []
|
final = []
|
||||||
time_last = None
|
time_last = None
|
||||||
wrote = 0
|
wrote = 0
|
||||||
for point in sorted(points, key=lambda l: l.time):
|
for point in sorted(points, key=lambda p: p.time):
|
||||||
if point.measurement not in measurements:
|
if point.measurement not in measurements:
|
||||||
# Wait until just before writing to drop measurement.
|
# Wait until just before writing to drop measurement.
|
||||||
client.drop_measurement(point.measurement)
|
client.drop_measurement(point.measurement)
|
||||||
|
@ -55,7 +55,7 @@ get_changes_filename() {
|
|||||||
|
|
||||||
# --dry and --cleanup should not be passed to rsync through $@
|
# --dry and --cleanup should not be passed to rsync through $@
|
||||||
# config file and possibly other opts including --force need to be
|
# config file and possibly other opts including --force need to be
|
||||||
for arg do
|
for arg; do
|
||||||
shift
|
shift
|
||||||
if [ "$arg" == '--force' ]; then
|
if [ "$arg" == '--force' ]; then
|
||||||
force=1
|
force=1
|
||||||
@ -82,7 +82,10 @@ done
|
|||||||
# set newargs as $@
|
# set newargs as $@
|
||||||
set -- "${newargs[@]}"
|
set -- "${newargs[@]}"
|
||||||
|
|
||||||
. "$1" || { echo "need to specify config file" >&2; exit 1; }
|
. "$1" || {
|
||||||
|
echo "need to specify config file" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
shift
|
shift
|
||||||
|
|
||||||
stage="/srv/ftp-stage/pub/opensuse/$path"
|
stage="/srv/ftp-stage/pub/opensuse/$path"
|
||||||
@ -140,10 +143,10 @@ for flavor in "${flavors[@]}"; do
|
|||||||
# new way, use the obs generated changelogs
|
# new way, use the obs generated changelogs
|
||||||
$dryrun rsync -avvhiH $stage/$changes \
|
$dryrun rsync -avvhiH $stage/$changes \
|
||||||
--link-dest=$stage \
|
--link-dest=$stage \
|
||||||
$dest/$changes $dry_delete "$@" \
|
$dest/$changes $dry_delete "$@" |
|
||||||
| LC_ALL=C grep -v '^\.[fdL] ' \
|
LC_ALL=C grep -v '^\.[fdL] ' |
|
||||||
| LC_ALL=C grep -v '^\(sending\|delta\)' \
|
LC_ALL=C grep -v '^\(sending\|delta\)' |
|
||||||
| tee -a $log
|
tee -a $log
|
||||||
else
|
else
|
||||||
# old way (already broken?)
|
# old way (already broken?)
|
||||||
if [ ! -s "$changes" ]; then
|
if [ ! -s "$changes" ]; then
|
||||||
@ -163,12 +166,12 @@ for flavor in "${flavors[@]}"; do
|
|||||||
break
|
break
|
||||||
else
|
else
|
||||||
get_iso_link
|
get_iso_link
|
||||||
if [ "`readlink $link`" != "$iso" ]; then
|
if [ "$(readlink $link)" != "$iso" ]; then
|
||||||
$dryrun ln -sf "$iso" "$link"
|
$dryrun ln -sf "$iso" "$link"
|
||||||
$dryrun ln -sf "$iso.sha256" "$link.sha256"
|
$dryrun ln -sf "$iso.sha256" "$link.sha256"
|
||||||
fi
|
fi
|
||||||
if [ -z "$force" ]; then
|
if [ -z "$force" ]; then
|
||||||
if test `date -d "$PUBLISH_DELAY hours ago" +%s` -lt `stat -c "%Z" "$stage/$isodir/$iso"`; then
|
if test $(date -d "$PUBLISH_DELAY hours ago" +%s) -lt $(stat -c "%Z" "$stage/$isodir/$iso"); then
|
||||||
echo "$iso was created less than $PUBLISH_DELAY hours ago, delay publishing" | tee -a $synclog
|
echo "$iso was created less than $PUBLISH_DELAY hours ago, delay publishing" | tee -a $synclog
|
||||||
do_sync_isos=0
|
do_sync_isos=0
|
||||||
fi
|
fi
|
||||||
@ -190,7 +193,10 @@ for r in "${repos[@]/#//repo/}"; do
|
|||||||
break 2
|
break 2
|
||||||
fi
|
fi
|
||||||
elif [ -e "$stage$r/media.1/media" ]; then
|
elif [ -e "$stage$r/media.1/media" ]; then
|
||||||
{ read dummy; read build; } < "$stage$r/media.1/media"
|
{
|
||||||
|
read dummy
|
||||||
|
read build
|
||||||
|
} <"$stage$r/media.1/media"
|
||||||
stamp="${build#*Build}"
|
stamp="${build#*Build}"
|
||||||
if [ "$build" = "$stamp" ]; then
|
if [ "$build" = "$stamp" ]; then
|
||||||
echo "ERROR: build id not parsable: $build. not syncing"
|
echo "ERROR: build id not parsable: $build. not syncing"
|
||||||
@ -256,10 +262,10 @@ for i in "${TODO[@]}"; do
|
|||||||
echo ========== $i $dry_delete ===========
|
echo ========== $i $dry_delete ===========
|
||||||
$dryrun rsync -avvhiH $stage/$i \
|
$dryrun rsync -avvhiH $stage/$i \
|
||||||
--link-dest=$stage \
|
--link-dest=$stage \
|
||||||
$dest $dry_delete "$@" \
|
$dest $dry_delete "$@" |
|
||||||
| LC_ALL=C grep -v '^\.[fdL] ' \
|
LC_ALL=C grep -v '^\.[fdL] ' |
|
||||||
| LC_ALL=C grep -v '^\(sending\|delta\)' \
|
LC_ALL=C grep -v '^\(sending\|delta\)' |
|
||||||
| tee -a $log
|
tee -a $log
|
||||||
done
|
done
|
||||||
|
|
||||||
# also sync source and debug, not bind mounted for Leap
|
# also sync source and debug, not bind mounted for Leap
|
||||||
|
@ -381,7 +381,8 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
|
|
||||||
# not declined but not accepted either
|
# not declined but not accepted either
|
||||||
review = self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
review = self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
||||||
self.assertIn("Source URLs are not valid. Try `osc service runall download_files`.\nblowfish-1.tar.gz", review.comment)
|
self.assertIn("Source URLs are not valid. Try `osc service runall download_files`.", review.comment)
|
||||||
|
self.assertIn("ERROR: Failed to download \"https://example.com/blowfish-1.tar.gz\"", review.comment)
|
||||||
|
|
||||||
@pytest.mark.usefixtures("default_config")
|
@pytest.mark.usefixtures("default_config")
|
||||||
def test_existing_source_urls(self):
|
def test_existing_source_urls(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user