Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/1.18.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dallinb committed Aug 25, 2022
2 parents a77c3d6 + 0da369c commit fd04e96
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 91 deletions.
175 changes: 142 additions & 33 deletions .gitchangelog.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8; mode: python -*-
import yaml

##
## Format
##
Expand Down Expand Up @@ -53,6 +51,7 @@ import yaml
## message will be displayed in the changelog without reformatting.


##
## ``ignore_regexps`` is a line of regexps
##
## Any commit having its full commit message matching any regexp listed here
Expand Down Expand Up @@ -130,8 +129,18 @@ section_regexps = [
## whatever given ``msg`` if the current text is empty.
##
## Additionally, you can `pipe` the provided filters, for instance:
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') | Indent(chars=" ")
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)')
#body_process = noop
body_process = ReSub(r'((^|\n)[A-Z]\w+(-\w+)*: .*(\n\s+.*)*)+$', r'') | strip


## ``subject_process`` is a callable
##
## This callable will be given the original subject and result will
## be used in the changelog.
##
## Available constructs are those listed in ``body_process`` doc.
subject_process = (strip |
ReSub(r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') |
SetIfEmpty("No commit message.") | ucfirst | final_dot)
Expand All @@ -144,39 +153,139 @@ subject_process = (strip |
tag_filter_regexp = r'^[0-9]+\.[0-9]+(\.[0-9]+)?$'


## ``unreleased_version_label`` is a string or a callable that outputs a string
##
## This label will be used as the changelog Title of the last set of changes
## between last valid tag and HEAD if any.
import yaml

with open('vars/main.yml') as stream:
unreleased_version_label = yaml.safe_load(stream)['cassandra_role_version']

## ``output_engine`` is a callable
##
## This will change the output format of the generated changelog file
##
## Available choices are:
##
## - rest_py
##
## Legacy pure python engine, outputs ReSTructured text.
## This is the default.
##
## - mustache(<template_name>)
##
## Template name could be any of the available templates in
## ``templates/mustache/*.tpl``.
## Requires python package ``pystache``.
## Examples:
## - mustache("markdown")
## - mustache("restructuredtext")
##
## - makotemplate(<template_name>)
##
## Template name could be any of the available templates in
## ``templates/mako/*.tpl``.
## Requires python package ``mako``.
## Examples:
## - makotemplate("restructuredtext")
##
#output_engine = rest_py
#output_engine = mustache("restructuredtext")
output_engine = mustache("markdown")
#output_engine = makotemplate("restructuredtext")


## ``include_merge`` is a boolean
##
## This option tells git-log whether to include merge commits in the log.
## The default is to include them.
include_merge = False
log_encoding = 'utf-8'
OUTPUT_FILE = "CHANGELOG.md"
INSERT_POINT_REGEX = r'''(?isxu)
^
(
\s*\#\s+Changelog\s*(\n|\r\n|\r) ## ``Changelog`` line
)
( ## Match all between changelog and release rev
(
(?!
(?<=(\n|\r)) ## look back for newline
\#\#\s+%(rev)s ## revision
\s+
\([0-9]+-[0-9]{2}-[0-9]{2}\)(\n|\r\n|\r) ## date
)
.
)*
)
(?P<tail>\#\#\s+(?P<rev>%(rev)s))
''' % {'rev': r"[0-9]+\.[0-9]+(\.[0-9]+)?"}

revs = [
Caret(FileFirstRegexMatch(OUTPUT_FILE, INSERT_POINT_REGEX)),
'HEAD'
]
publish = FileInsertAtFirstRegexMatch(
OUTPUT_FILE, INSERT_POINT_REGEX,
idx=lambda m: m.start(1)
)


## ``log_encoding`` is a string identifier
##
## This option tells gitchangelog what encoding is outputed by ``git log``.
## The default is to be clever about it: it checks ``git config`` for
## ``i18n.logOutputEncoding``, and if not found will default to git's own
## default: ``utf-8``.
#log_encoding = 'utf-8'


## ``publish`` is a callable
##
## Sets what ``gitchangelog`` should do with the output generated by
## the output engine. ``publish`` is a callable taking one argument
## that is an interator on lines from the output engine.
##
## Some helper callable are provided:
##
## Available choices are:
##
## - stdout
##
## Outputs directly to standard output
## (This is the default)
##
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start(), flags)
##
## Creates a callable that will parse given file for the given
## regex pattern and will insert the output in the file.
## ``idx`` is a callable that receive the matching object and
## must return a integer index point where to insert the
## the output in the file. Default is to return the position of
## the start of the matched string.
##
## - FileRegexSubst(file, pattern, replace, flags)
##
## Apply a replace inplace in the given file. Your regex pattern must
## take care of everything and might be more complex. Check the README
## for a complete copy-pastable example.
##
# publish = FileInsertIntoFirstRegexMatch(
# "CHANGELOG.rst",
# r'/(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n/',
# idx=lambda m: m.start(1)
# )
#publish = stdout


## ``revs`` is a list of callable or a list of string
##
## callable will be called to resolve as strings and allow dynamical
## computation of these. The result will be used as revisions for
## gitchangelog (as if directly stated on the command line). This allows
## to filter exaclty which commits will be read by gitchangelog.
##
## To get a full documentation on the format of these strings, please
## refer to the ``git rev-list`` arguments. There are many examples.
##
## Using callables is especially useful, for instance, if you
## are using gitchangelog to generate incrementally your changelog.
##
## Some helpers are provided, you can use them::
##
## - FileFirstRegexMatch(file, pattern): will return a callable that will
## return the first string match for the given pattern in the given file.
## If you use named sub-patterns in your regex pattern, it'll output only
## the string matching the regex pattern named "rev".
##
## - Caret(rev): will return the rev prefixed by a "^", which is a
## way to remove the given revision and all its ancestor.
##
## Please note that if you provide a rev-list on the command line, it'll
## replace this value (which will then be ignored).
##
## If empty, then ``gitchangelog`` will act as it had to generate a full
## changelog.
##
## The default is to use all commits to make the changelog.
#revs = ["^1.0.3", ]
#revs = [
# Caret(
# FileFirstRegexMatch(
# "CHANGELOG.rst",
# r"(?P<rev>[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n")),
# "HEAD"
#]
revs = []
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ jobs:
strategy:
matrix:
include:
- image-version: centos7
command: /usr/sbin/init
distro: centos
tag: 7
# Disable Tests for CentOS 7 due to https://github.com/locp/ansible-role-cassandra/issues/155
# - image-version: centos7
# command: /usr/sbin/init
# distro: centos
# tag: 7
- image-version: centos8
command: /usr/sbin/init
distro: centos
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
## 1.18.0
# Changelog


## 1.18.1

### Changes

* Migrate to testinfra-bdd 2.0.0. [Ben Dalling]

### Fix

* Change apache package repository URLs to new location (CASSANDRA-17748) [Hauke Hans]

* Disable testing against CentOS 7. [Ben Dalling]

* Correct Lint errors in metadata file. [Ben Dalling]


## 1.18.0 (2022-07-17)

### New

Expand Down
28 changes: 12 additions & 16 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ galaxy_info:

namespace: locp

github_branch: main

license: GPLv3

min_ansible_version: 2.12.6
Expand All @@ -30,8 +28,8 @@ galaxy_info:
platforms:
- name: EL
versions:
- 7
- 8
- '7'
- '8'
- name: Ubuntu
versions:
- bionic
Expand All @@ -45,15 +43,13 @@ galaxy_info:
- stretch
- name: Fedora
versions:
- 27
- 28
- 29
- 30 # https://github.com/ansible/galaxy/issues/1926
- 31 # https://github.com/ansible/galaxy/issues/2105
- 32 # https://github.com/ansible/galaxy/issues/2356
- 33 # https://github.com/ansible/galaxy/issues/2533
- 34
- 35
- 36

dependencies: []
- '27'
- '28'
- '29'
- '30' # https://github.com/ansible/galaxy/issues/1926
- '31' # https://github.com/ansible/galaxy/issues/2105
- '32' # https://github.com/ansible/galaxy/issues/2356
- '33' # https://github.com/ansible/galaxy/issues/2533
- '34'
- '35'
- '36'
2 changes: 1 addition & 1 deletion molecule/default/tests/test_supported_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_platform_is_supported(self):
supported_versions = platform['versions']

if platform_name == 'EL' or platform_name == 'Fedora':
version = int(host.system_info.release.split('.')[0])
version = host.system_info.release.split('.')[0]
else:
version = host.system_info.codename

Expand Down
33 changes: 6 additions & 27 deletions molecule/latest/tests/step_defs/test_cassandra.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
"""Test Cassandra feature tests."""

from pytest_bdd import scenario
import testinfra_bdd
from pytest_bdd import scenarios

# Ensure that the PyTest fixtures provided in testinfra-bdd are available to
# your test suite.
pytest_plugins = ['testinfra_bdd']


@scenario('../features/cassandra.feature', 'Check that a File Contains an Expected String')
def test_check_that_a_file_contains_an_expected_string():
"""Check that a File Contains an Expected String."""


@scenario('../features/cassandra.feature', 'Check that a file exists and matches an expected type')
def test_check_that_a_file_exists_and_matches_an_expected_type():
"""Check that a file exists and matches an expected type."""
scenarios('../features/cassandra.feature')


@scenario('../features/cassandra.feature', 'Check the Cassandra Service and Package')
def test_check_the_cassandra_service_and_package():
"""Check the Cassandra Service and Package."""


@scenario('../features/cassandra.feature', 'Custom Directories')
def test_custom_directories():
"""Custom Directories."""


@scenario('../features/cassandra.feature', 'Run the nodetool command')
def test_run_the_nodetool_command():
"""Run the nodetool command."""
# Ensure that the PyTest fixtures provided in testinfra-bdd are available to
# your test suite.
pytest_plugins = testinfra_bdd.PYTEST_MODULES
2 changes: 1 addition & 1 deletion molecule/latest/tests/test_supported_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_platform_is_supported(self):
supported_versions = platform['versions']

if platform_name == 'EL' or platform_name == 'Fedora':
version = int(host.system_info.release.split('.')[0])
version = host.system_info.release.split('.')[0]
else:
version = host.system_info.codename

Expand Down
Loading

0 comments on commit fd04e96

Please sign in to comment.