diff --git a/CHANGELOG.md b/CHANGELOG.md index 18742324f58..b92117d1627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Change log ========== +1.21.2 (2018-05-03) +------------------- + +### Bugfixes + +- Fixed a bug where the ip_range attirbute in IPAM configs was prevented + from passing validation + 1.21.1 (2018-04-27) ------------------- diff --git a/compose/__init__.py b/compose/__init__.py index 6baeabc14d2..34974e80418 100644 --- a/compose/__init__.py +++ b/compose/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from __future__ import unicode_literals -__version__ = '1.21.1' +__version__ = '1.21.2' diff --git a/compose/config/config_schema_v2.0.json b/compose/config/config_schema_v2.0.json index 793cef1d6db..419f2e28c9d 100644 --- a/compose/config/config_schema_v2.0.json +++ b/compose/config/config_schema_v2.0.json @@ -311,7 +311,7 @@ "type": "object", "properties": { "subnet": {"type": "string"}, - "iprange": {"type": "string"}, + "ip_range": {"type": "string"}, "gateway": {"type": "string"}, "aux_addresses": { "type": "object", diff --git a/compose/config/config_schema_v2.1.json b/compose/config/config_schema_v2.1.json index 5ea763544fe..3cb1ee21316 100644 --- a/compose/config/config_schema_v2.1.json +++ b/compose/config/config_schema_v2.1.json @@ -365,7 +365,7 @@ "type": "object", "properties": { "subnet": {"type": "string"}, - "iprange": {"type": "string"}, + "ip_range": {"type": "string"}, "gateway": {"type": "string"}, "aux_addresses": { "type": "object", diff --git a/compose/config/config_schema_v2.2.json b/compose/config/config_schema_v2.2.json index a19d4c94514..8e1f288badf 100644 --- a/compose/config/config_schema_v2.2.json +++ b/compose/config/config_schema_v2.2.json @@ -374,7 +374,7 @@ "type": "object", "properties": { "subnet": {"type": "string"}, - "iprange": {"type": "string"}, + "ip_range": {"type": "string"}, "gateway": {"type": "string"}, "aux_addresses": { "type": "object", diff --git a/compose/config/config_schema_v2.3.json b/compose/config/config_schema_v2.3.json index 78b716a7a7a..659dbcd1a49 100644 --- a/compose/config/config_schema_v2.3.json +++ b/compose/config/config_schema_v2.3.json @@ -418,7 +418,7 @@ "type": "object", "properties": { "subnet": {"type": "string"}, - "iprange": {"type": "string"}, + "ip_range": {"type": "string"}, "gateway": {"type": "string"}, "aux_addresses": { "type": "object", diff --git a/compose/config/config_schema_v2.4.json b/compose/config/config_schema_v2.4.json index a5796d5b12a..47e11875577 100644 --- a/compose/config/config_schema_v2.4.json +++ b/compose/config/config_schema_v2.4.json @@ -417,7 +417,7 @@ "type": "object", "properties": { "subnet": {"type": "string"}, - "iprange": {"type": "string"}, + "ip_range": {"type": "string"}, "gateway": {"type": "string"}, "aux_addresses": { "type": "object", diff --git a/script/build/windows.ps1 b/script/build/windows.ps1 index 98a74815801..1de9bbfa4a2 100644 --- a/script/build/windows.ps1 +++ b/script/build/windows.ps1 @@ -44,16 +44,10 @@ virtualenv .\venv # pip and pyinstaller generate lots of warnings, so we need to ignore them $ErrorActionPreference = "Continue" -# Install dependencies -# Fix for https://github.com/pypa/pip/issues/3964 -# Remove-Item -Recurse -Force .\venv\Lib\site-packages\pip -# .\venv\Scripts\easy_install pip==9.0.1 -# .\venv\Scripts\pip install --upgrade pip setuptools -# End fix .\venv\Scripts\pip install pypiwin32==220 .\venv\Scripts\pip install -r requirements.txt .\venv\Scripts\pip install --no-deps . -.\venv\Scripts\pip install --allow-external pyinstaller -r requirements-build.txt +.\venv\Scripts\pip install -r requirements-build.txt git rev-parse --short HEAD | out-file -encoding ASCII compose\GITSHA diff --git a/script/release/Dockerfile b/script/release/Dockerfile index 0d4ec27e1da..e5af676a50a 100644 --- a/script/release/Dockerfile +++ b/script/release/Dockerfile @@ -3,7 +3,8 @@ RUN mkdir -p /src && pip install -U Jinja2==2.10 \ PyGithub==1.39 \ pypandoc==1.4 \ GitPython==2.1.9 \ - requests==2.18.4 && \ + requests==2.18.4 \ + twine==1.11.0 && \ apt-get update && apt-get install -y pandoc VOLUME /src/script/release diff --git a/script/release/release.py b/script/release/release.py index add8fb2d353..d0545a7e647 100755 --- a/script/release/release.py +++ b/script/release/release.py @@ -27,6 +27,7 @@ from release.utils import update_init_py_version from release.utils import update_run_sh_version from release.utils import yesno +from twine.commands.upload import main as twine_upload def create_initial_branch(repository, args): @@ -78,10 +79,9 @@ def monitor_pr_status(pr_data): continue summary[detail.state] += 1 print('{pending} pending, {success} successes, {failure} failures'.format(**summary)) - if status.total_count == 0: - # Mostly for testing purposes against repos with no CI setup - return True - elif summary['pending'] == 0 and summary['failure'] == 0: + if summary['pending'] == 0 and summary['failure'] == 0 and summary['success'] > 0: + # This check assumes at least 1 non-DCO CI check to avoid race conditions. + # If testing on a repo without CI, use --skip-ci-check to avoid looping eternally return True elif summary['failure'] > 0: raise ScriptError('CI failures detected!') @@ -156,7 +156,8 @@ def resume(args): if not pr_data: pr_data = repository.create_release_pull_request(args.release) check_pr_mergeable(pr_data) - monitor_pr_status(pr_data) + if not args.skip_ci: + monitor_pr_status(pr_data) downloader = BinaryDownloader(args.destination) files = downloader.download_all(args.release) if not gh_release: @@ -195,7 +196,8 @@ def start(args): create_initial_branch(repository, args) pr_data = repository.create_release_pull_request(args.release) check_pr_mergeable(pr_data) - monitor_pr_status(pr_data) + if not args.skip_ci: + monitor_pr_status(pr_data) downloader = BinaryDownloader(args.destination) files = downloader.download_all(args.release) gh_release = create_release_draft(repository, args.release, pr_data, files) @@ -239,8 +241,8 @@ def finalize(args): if not merge_status.merged: raise ScriptError('Unable to merge PR #{}: {}'.format(pr_data.number, merge_status.message)) print('Uploading to PyPi') - run_setup(os.path.join(REPO_ROOT, 'setup.py'), script_args=['upload']) - img_manager.push_images(args.release) + twine_upload(['dist/*']) + img_manager.push_images() repository.publish_release(gh_release) except ScriptError as e: print(e) @@ -310,6 +312,10 @@ def main(): '--no-cherries', '-C', dest='cherries', action='store_false', help='If set, the program will not prompt the user for PR numbers to cherry-pick' ) + parser.add_argument( + '--skip-ci-checks', dest='skip_ci', action='store_true', + help='If set, the program will not wait for CI jobs to complete' + ) args = parser.parse_args() if args.action == 'start': diff --git a/script/release/release.sh b/script/release/release.sh index 2310429aaa2..affbce37b90 100755 --- a/script/release/release.sh +++ b/script/release/release.sh @@ -19,6 +19,7 @@ docker run -e GITHUB_TOKEN=$GITHUB_TOKEN -e BINTRAY_TOKEN=$BINTRAY_TOKEN -it \ --mount type=bind,source=$(pwd),target=/src \ --mount type=bind,source=$(pwd)/.git,target=/src/.git \ --mount type=bind,source=$HOME/.docker,target=/root/.docker \ + --mount type=bind,source=$HOME/.gitconfig,target=/root/.gitconfig \ --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \ --mount type=bind,source=$HOME/.ssh,target=/root/.ssh \ -v $HOME/.pypirc:/root/.pypirc \ diff --git a/script/release/release/images.py b/script/release/release/images.py index 0c7bb20454e..d238d4d7fb6 100644 --- a/script/release/release/images.py +++ b/script/release/release/images.py @@ -23,6 +23,7 @@ def build_images(self, repository, files): distdir = os.path.join(REPO_ROOT, 'dist') os.makedirs(distdir, exist_ok=True) shutil.copy(files['docker-compose-Linux-x86_64'][0], distdir) + os.chmod(os.path.join(distdir, 'docker-compose-Linux-x86_64'), 0o755) print('Building docker/compose image') logstream = docker_client.build( REPO_ROOT, tag='docker/compose:{}'.format(self.version), dockerfile='Dockerfile.run', diff --git a/script/release/release/repository.py b/script/release/release/repository.py index d4d1c720111..9a5d432c084 100644 --- a/script/release/release/repository.py +++ b/script/release/release/repository.py @@ -196,6 +196,24 @@ def apply_patch(self, patch_data): f.flush() self.git_repo.git.am('--3way', f.name) + def get_prs_in_milestone(self, version): + milestones = self.gh_repo.get_milestones(state='open') + milestone = None + for ms in milestones: + if ms.title == version: + milestone = ms + break + if not milestone: + print('Didn\'t find a milestone matching "{}"'.format(version)) + return None + + issues = self.gh_repo.get_issues(milestone=milestone, state='all') + prs = [] + for issue in issues: + if issue.pull_request is not None: + prs.append(issue.number) + return sorted(prs) + def get_contributors(pr_data): commits = pr_data.get_commits() diff --git a/script/run/run.sh b/script/run/run.sh index 45e74febd9f..60e06996b71 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -15,7 +15,7 @@ set -e -VERSION="1.21.1" +VERSION="1.21.2" IMAGE="docker/compose:$VERSION" diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index 4562a99ca41..085a2d01092 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -1344,6 +1344,38 @@ def test_config_invalid_ipam_config(self): assert ('networks.foo.ipam.config contains an invalid type,' ' it should be an object') in excinfo.exconly() + def test_config_valid_ipam_config(self): + ipam_config = { + 'subnet': '172.28.0.0/16', + 'ip_range': '172.28.5.0/24', + 'gateway': '172.28.5.254', + 'aux_addresses': { + 'host1': '172.28.1.5', + 'host2': '172.28.1.6', + 'host3': '172.28.1.7', + }, + } + networks = config.load( + build_config_details( + { + 'version': str(V2_1), + 'networks': { + 'foo': { + 'driver': 'default', + 'ipam': { + 'driver': 'default', + 'config': [ipam_config], + } + } + } + }, + filename='filename.yml', + ) + ).networks + + assert 'foo' in networks + assert networks['foo']['ipam']['config'] == [ipam_config] + def test_config_valid_service_names(self): for valid_name in ['_', '-', '.__.', '_what-up.', 'what_.up----', 'whatup']: services = config.load(