GithubHelp home page GithubHelp logo

googleapis / releasetool Goto Github PK

View Code? Open in Web Editor NEW
30.0 30.0 28.0 799 KB

A utility for release Google client libraries across a variety of languages.

License: Apache License 2.0

Python 97.09% Shell 2.66% Jinja 0.24%

releasetool's Introduction

Google APIs

This repository contains the original interface definitions of public Google APIs that support both REST and gRPC protocols. Reading the original interface definitions can provide a better understanding of Google APIs and help you to utilize them more efficiently. You can also use these definitions with open source tools to generate client libraries, documentation, and other artifacts.

Building

Bazel

The recommended way to build the API client libraries is through Bazel >= 4.2.2.

First, install bazel.

To build all libraries:

bazel build //...

To test all libraries:

bazel test //...

To build one library in all languages:

bazel build //google/example/library/v1/...

To build the Java package for one library:

bazel build //google/example/library/v1:google-cloud-example-library-v1-java

Bazel packages exist in all the libraries for Java, Go, Python, Ruby, Node.js, PHP and C#.

Overview

Google APIs are typically deployed as API services that are hosted under different DNS names. One API service may implement multiple APIs and multiple versions of the same API.

Google APIs use Protocol Buffers version 3 (proto3) as their Interface Definition Language (IDL) to define the API interface and the structure of the payload messages. The same interface definition is used for both REST and RPC versions of the API, which can be accessed over different wire protocols.

There are several ways of accessing Google APIs:

  1. JSON over HTTP: You can access all Google APIs directly using JSON over HTTP, using Google API client library or third-party API client libraries.

  2. Protocol Buffers over gRPC: You can access Google APIs published in this repository through GRPC, which is a high-performance binary RPC protocol over HTTP/2. It offers many useful features, including request/response multiplex and full-duplex streaming.

  3. Google Cloud Client Libraries: You can use these libraries to access Google Cloud APIs. They are based on gRPC for better performance and provide idiomatic client surface for better developer experience.

Discussions

This repo contains copies of Google API definitions and related files. For discussions or to raise issues about Google API client libraries, GRPC or Google Cloud Client Libraries please refer to the repos associated with each area.

Repository Structure

This repository uses a directory hierarchy that reflects the Google API product structure. In general, every API has its own root directory, and each major version of the API has its own subdirectory. The proto package names exactly match the directory: this makes it easy to locate the proto definitions and ensures that the generated client libraries have idiomatic namespaces in most programming languages. Alongside the API directories live the configuration files for the GAPIC toolkit.

NOTE: The major version of an API is used to indicate breaking change to the API.

Generate gRPC Source Code

To generate gRPC source code for Google APIs in this repository, you first need to install both Protocol Buffers and gRPC on your local machine, then you can run make LANGUAGE=xxx all to generate the source code. You need to integrate the generated source code into your application build system.

NOTE: The Makefile is only intended to generate source code for the entire repository. It is not for generating linkable client library for a specific API. Please see other repositories under https://github.com/googleapis for generating linkable client libraries.

Go gRPC Source Code

It is difficult to generate Go gRPC source code from this repository, since Go has different directory structure. Please use this repository instead.

releasetool's People

Contributors

bajajneha27 avatar bcoe avatar bshaffer avatar busunkim96 avatar callmehiphop avatar chingor13 avatar crwilcox avatar dazuma avatar ddixit14 avatar dependabot[bot] avatar diptanshumittal avatar google-cloud-policy-bot[bot] avatar jba avatar jkwlui avatar joewang1127 avatar jskeet avatar justinbeckwith avatar kappratiksha avatar kjin avatar nivedhasenthil avatar parthea avatar quartzmo avatar release-please[bot] avatar renovate-bot avatar steffnay avatar surferjeffatgoogle avatar theacodes avatar theroyaltnetennba avatar tseaver avatar tswast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

releasetool's Issues

Switch back to master after release

After running release tool, it left me in an autogenerated branch it used for the release:

releasetool (release-releasetool-0.1.1) $ 

After the release, it should return to the master branch, or which ever branch I was originally on.

Release branch is too divergent from 'master'

For instance, I just ran releasetool to create googleapis/google-cloud-python#6139. The diff shown in the PR looks right, but the following causes CI to trigger for inappropriate sections:

$ git checkout master && git fetch --all --prune &&  git merge upstream/master
Switched to branch 'master'
Your branch is up-to-date with 'upstream/master'.
Fetching origin
Fetching upstream
Already up-to-date.
.circleci/config.yml
.kokoro/build.sh
.kokoro/continuous/asset.cfg
.kokoro/continuous/automl.cfg
....
kokoro/continuous/translate.cfg
.kokoro/continuous/websecurityscanner.cfg
.kokoro/presubmit/asset.cfg
.kokoro/presubmit/automl.cfg
...
.kokoro/presubmit/translate.cfg
.kokoro/presubmit/websecurityscanner.cfg
README.rst
api_core/CHANGELOG.md
api_core/nox.py
api_core/setup.cfg
api_core/setup.py
bigquery/google/cloud/bigquery/client.py
bigquery/google/cloud/bigquery/job.py
bigquery/tests/unit/test_client.py
bigquery/tests/unit/test_job.py
bigtable/README.rst
bigtable/setup.py
dlp/CHANGELOG.md
dlp/setup.py
dlp/synth.py
firestore/tests/unit/testdata/create-all-transforms.textproto
firestore/tests/unit/testdata/create-arrayremove-multi.textproto
...
firestore/tests/unit/testdata/update-paths-st-with-empty-map.textproto
firestore/tests/unit/testdata/update-st-with-empty-map.textproto
logging/google/cloud/logging/_helpers.py
logging/google/cloud/logging/client.py
logging/google/cloud/logging/entries.py
logging/google/cloud/logging/handlers/app_engine.py
logging/google/cloud/logging/logger.py
logging/tests/unit/handlers/test_app_engine.py
logging/tests/unit/test__helpers.py
logging/tests/unit/test_entries.py
logging/tests/unit/test_logger.py
pubsub/setup.py
storage/setup.py
storage/tests/system.py
storage/tests/unit/test_blob.py
storage/tests/unit/test_bucket.py
trace/README.rst

When I ran releasetool, I was on an updated version of the master branch.

show change log for the release in PR comment

Instead of showing a boring This pull request was generated using releasetool. message, let's instead show the change log for the latest release so reviewer better understand the release.

[NodeJS] regenerate package-lock.json's

We need to run

rm -rf node_modules package-lock.json samples/node_modules samples/package-lock.json && npm install && cd samples/ && npm link ../ && npm install && cd ../

to ensure package-lock.json are up to date.

Provide way to reset GitHub api key

Context:
keyring storage can change depending on execution environment. On my linux box, keyring uses a different storage mechanism when logged into the desktop vs. via ssh.

I had reset my GitHub API key because running releasetool in the ssh session prompted me for my api key. This causes releasetool API calls to fail from my normal desktop sessions without a clear way to reset the API key.

Current workaround:

$ import keyring; print(keyring.delete_password('com.google.cloud.devrel.releasetool', 'github'))

Auto-detect nodejs

Everytime I run releasetool, it asks me if it's nodejs or python. This is very easy to figure out :) If there's a package.json in the root, can we just assume it's nodejs?

Generating an empty changelog

I'm running releasetool start against master in nodejs-common:
https://github.com/googleapis/nodejs-common/

It's popping up an empty change log, even though there are many changes.

nodejs-common (master) $ releasetool start
Which language (python, python-tool, nodejs)?: nodejs
o/ Hey, beckwith, let's release some stuff!
> Determining basic context.
GitHub Repo: JustinBeckwith/nodejs-common
> Figuring out the package name.
Looks like we're releasing nodejs-common.
> Figuring out what the last release was.
The last release was 0.20.3.
> Gathering changes since 0.20.3
Cool, 1 changes found.
> Opening your editor to finalize release notes.

And the changelog it generates:

- 

### Implementation Changes

### New Features

### Dependencies

### Documentation

### Internal / Testing Changes

The actual changes:

3894cf4 chore: update renovate config (#202)
beda6c2 fix: make ServiceObject#id protected to allow subclass access (#200)
3004afa refactor: remove circular imports (#201)
3f764bf fix: special JSON.stringify for for strictEqual test (#199)
dbddd19 chore: assert.deelEqual => assert.deepStrictEqual (#196)
ba0f858 chore: move mocha options to mocha.opts (#195)
be06c73 chore(deps): update dependency gts to ^0.8.0 (#192)
94afcdf chore: cut out code split into other modules (#194)
46c910a Update config.yml (#191)
3d74038 fix: drop support for node.js 4.x and 9.x (#190)

error determining github context

WIth v0.7.0:

~/src/veneer/nodejs-logging master
❯ releasetool start
o/ Hey, ofrobots, let's release some stuff!
> Determining GitHub context.
Traceback (most recent call last):
  File "/Users/ofrobots/homebrew/bin/releasetool", line 11, in <module>
    sys.exit(main())
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/releasetool/main.py", line 101, in start
    return releasetool.commands.start.nodejs.start()
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/releasetool/commands/start/nodejs.py", line 229, in start
    releasetool.commands.common.setup_github_context(ctx)
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/releasetool/commands/common.py", line 84, in setup_github_context
    _determine_origin(ctx)
  File "/Users/ofrobots/homebrew/lib/python3.6/site-packages/releasetool/commands/common.py", line 37, in _determine_origin
    origin = remotes["origin"]
KeyError: 'origin'

~/src/veneer/nodejs-logging master
❯ git remote -v
ofrobots        [email protected]:ofrobots/nodejs-logging.git (fetch)
ofrobots        [email protected]:ofrobots/nodejs-logging.git (push)
origin  https://github.com/googleapis/nodejs-logging (fetch)
origin  https://github.com/googleapis/nodejs-logging (push)

LMK if any more info is needed.

syntax error with freshly installed releasetool

After addressing #145, trying to use releasetool, I get the following error:

$ releasetool start
Traceback (most recent call last):
  File "/home/ofrobots/.local/bin/releasetool", line 7, in <module>
    from releasetool.main import main
  File "/home/ofrobots/.local/lib/python3.5/site-packages/releasetool/main.py", line 82
    prompt=f"Which language ({', '.join(_language_choices)})?",
                                                             ^
SyntaxError: invalid syntax

This would be a duplicate of #68, but given that is closed and I still ran into the issue means that the issue has not really been addressed. My understanding is that I need python 3.6, and the README should make this (or other disposition) clearer.

Autorelease failing to create release for nodejs-monitoring

Autorelease is having trouble releasing nodejs-monitoring. Release @google-cloud/monitoring v0.6.0 #197

Processing Release @google-cloud/monitoring v0.6.0: https://github.com/googleapis/nodejs-monitoring/pull/197
> Determining what the release tag should be.
Release tag is v0.6.0.
> Determining the package version.
package version: v0.6.0.
> Grabbing the release notes.
> Creating the release.
HTTPError('422 Client Error: Unprocessable Entity for url: https://api.github.com/repos/googleapis/nodejs-monitoring/releases',)

Support semver for all Python repositories

running releasetool start with the latest version, gcp-releasetool-2019.1.25 results in

> Figuring out what the last release was.
The last release was 0.32.1.
> Gathering changes since 0.32.1
Cool, 2 changes found.
> Opening your editor to finalize release notes.
Releasing 2019.02.05.

Make tag/release creation idempotent

We can check ahead-of-time if a release already exists. If it does and the tag sha matches up, then we can safely do nothing and continue.

This will allow auto-release to safely re-run releasetool even if tags already exist, reducing the amount of noise.

Can't find last release in a node.js repo

I'm trying to use releasetool to ship a new version of nodejs-common. Generally we use the last tag with a v* to figure out the last release, but it looks like releasetool is having trouble figuring that out:

beckwith-macbookpro2:nodejs-common beckwith$ releasetool
o/ Hey, beckwith, let's release some stuff!
> Determining basic context.
GitHub Repo: JustinBeckwith/nodejs-common
> Figuring out the package name.
Looks like we're releasing nodejs-common.
> Figuring out what the last release was.
I couldn't figure out the last release for nodejs-common, so I'm assuming this is the first release. Can you tell me which git rev/sha to start the changelog at?

How is it trying to find the last release?

Setup Autorelease for Ruby

  • Create Kokoro release jobs for Ruby repositories
  • Make releasetool tag work in non-interactive mode
  • Have releasetool start and releasetool tag apply appropriate labels

See this document.

Set up CI

Just a tracking issue for setting up tests / CI on pull-requests

Attempts to release from my origin remote

I use a GitHub workflow where origin is my fork of the repository, and upstream is the true home of the repo. When I run releasetool, it tries to release from my fork:

releasetool (master) $ releasetool
o/ Hey, beckwith, let's release some stuff!
> Determining basic context.
GitHub Repo: JustinBeckwith/releasetool

Exception when origin doesn't end in .git

I think this is the underlying issue in #52 -- I encountered this as well. Once I added .git to my origin URL things were fine.

kelvinjin@spicydays:gcp-metadata$ releasetool start
o/ Hey, kelvinjin, let's release some stuff!
> Determining GitHub context.
Traceback (most recent call last):
  File "/usr/local/bin/releasetool", line 11, in <module>
    sys.exit(main())
  [...]
  File "/usr/local/lib/python3.7/site-packages/releasetool/commands/common.py", line 42, in _determine_origin
    origin = remotes["origin"]
KeyError: 'origin'
kelvinjin@spicydays:gcp-metadata$ git remote -v
kjin    [email protected]:kjin/gcp-metadata.git (fetch)
kjin    [email protected]:kjin/gcp-metadata.git (push)
origin  [email protected]:googleapis/gcp-metadata (fetch)
origin  [email protected]:googleapis/gcp-metadata (push)
kelvinjin@spicydays:gcp-metadata$ git remote set-url origin [email protected]:googleapis/gcp-metadata.git
kelvinjin@spicydays:gcp-metadata$ releasetool start
o/ Hey, kelvinjin, let's release some stuff!
> Determining GitHub context.
Origin: googleapis/gcp-metadata, Upstream: googleapis/gcp-metadata
> Comparing origin/master to master.
[...]

@ofrobots, were you able to get a chance to see if v0.8 fixed this issue? I tried with the new release (marked 2018.10.25) and it didn't work for me.

I think we should either highlight this in the README or allow .git to be omitted, because of the misleading error. I can contribute a PR if needed.

Getting started instructions should not assume that pip exists

Environment details

  • OS: Linux debian
  • Python version: 3.5.3
  • pip version: none installed
  • releasetool version: none installed

Steps to reproduce

  1. Follow installation instructions from the README.
  2. Installation fails if pip isn't already installed.

releasetool assume that either the use already has pip or is knowledgeable enough about python to be able to install pip.

$ python3 -m pip install --user --upgrade gcp-releasetool
/usr/bin/python3: No module named pip

It would be really nice if the README could provide instructions on how to proceed here 😸

Origin/master must be up to date

I am trying to run releasetool start start against a nodejs project, in my case nodejs-logging. It detects 0 changes, when in fact there are 34. It turned out that it required my origin/master to have all the changes, but I never really push there. My local git index was up to date when compared to upstream/master.

Trouble finding the last release

I'm trying to run releasetool start against this repository:
https://github.com/googleapis/nodejs-datastore-session

I get this output, and it tries to release a 0.1.0:

nodejs-datastore-session (master) $ releasetool start
o/ Hey, beckwith, let's release some stuff!
> Determining GitHub context.
Origin: JustinBeckwith/nodejs-datastore-session, Upstream: googleapis/nodejs-datastore-session
> Comparing upstream/master to master.
master is up to date with upstream/master
> Figuring out the package name.
Looks like we're releasing @google-cloud/connect-datastore.
> Figuring out what the last release was.
I couldn't figure out the last release for @google-cloud/connect-datastore, so I'm assuming this is the first release. Can you tell me which git rev/sha to start the changelog at?
Committish: 944ff59ca21f0e8a35f953cc929c4e0f0ddff659
The last release was 0.0.0.
> Gathering changes since 0.0.0
Cool, 37 changes found.

The problem here, is that there was a previous release. The release exists here:
https://github.com/googleapis/nodejs-datastore-session/releases/tag/1.0.0

The 1.0.0 version exists on npm too:
https://www.npmjs.com/package/@google-cloud/connect-datastore

Releasetool doesn't let me override the version, so it kinda forces me to do a 0.1.0, which obvs doesn't work.

Unprocessable entity for url:

$ ../../gcp-tools/bin/releasetool tag
o/ Hey, tseaver, let's tag a release!
> Determining GitHub context.
Origin: tseaver/google-cloud-python, Upstream: GoogleCloudPlatform/google-cloud-python
> Let's figure out which pull request corresponds to your release.
> Please pick one of the following PRs:

	1: Release api_core 1.4.1 (6133)
	2: Release dlp 0.8.0 (6106)
	3: Release dlp 0.8.0 (6105)

Which one do you want to tag and release?: 1
> Determining what the release tag should be.
Release tag is api_core-1.4.1.
> Determining the package name and version.
Package name: api_core, package version: 1.4.1.
> Grabbing the release notes.
> Creating the release.
Traceback (most recent call last):
  File "../../gcp-tools/bin/releasetool", line 11, in <module>
    sys.exit(main())
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/releasetool/main.py", line 112, in tag
    return releasetool.commands.tag.python.tag()
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/releasetool/commands/tag/python.py", line 151, in tag
    create_release(ctx)
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/releasetool/commands/tag/python.py", line 112, in create_release
    body=ctx.release_notes,
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/releasetool/github.py", line 89, in create_release
    response.raise_for_status()
  File "/home/tseaver/projects/agendaless/Google/src/gcp-tools/lib/python3.6/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.github.com/repositories/16316451/releases

releasetool won't allow a person to specify a version manually

Environment details

  • OS: macOS 10.13.6
  • Python version:
$ python --version
Python 2.7.10
$ python3 --version
Python 3.7.0
  • pip version:
$ pip --version
pip 10.0.1 from /Users/enocom/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)
$ pip3 --version
pip 18.1 from /Users/enocom/homebrew/lib/python3.7/site-packages/pip (python 3.7)
  • releasetool version:
$ releasetool --version
2018.12.10

Steps to reproduce

$ cd ~
$ git clone https://code.googlesource.com/gocloud
$ cd ~/gocloud
$ git tag -ln
# ... omitted for brevity
v0.34.0         all: release v0.34.0
$ releasetool start --language go
o/ Hey, enocom, let's release some stuff!
> Figuring out the module name.
Looks like we're releasing cloud.google.com/go (relative path ).
> Figuring out what the last release was.
I couldn't figure out the last release for cloud.google.com/go, 
so I'm assuming this is the first release. 
Can you tell me which git rev/sha to start the changelog at? 0ebda48a7f143b1cce9eb37a8c1106ac762a3430
> Creating branch release-cloud.google.com/go-0.1.0
Switched to a new branch 'release-cloud.google.com/go-0.1.0'

Note 0ebda48a7f143b1cce9eb37a8c1106ac762a3430 is the commitish of the last release: v0.34.0.

There are two problems above:

  1. releasetool fails to see the v0.34.0 tagged commit (which is the last release) and therefore erroneously assumes this is the first release.
  2. releasetool never gives a person the chance to identify the correct version and instead goes along with the wrong assumption from step 1 above.

/cc @jadekler

syntax error running `releasetool start` after fresh pip install

Traceback (most recent call last):
  File "/usr/local/bin/releasetool", line 7, in <module>
    from releasetool.main import main
  File "/usr/local/lib/python3.5/dist-packages/releasetool/main.py", line 82
    prompt=f"Which language ({', '.join(_language_choices)})?",
                                                             ^
SyntaxError: invalid syntax

Releasetool using YYYY.mm.dd versioning for package that expects semver

(venv) crwilcox@redrover ~/w/r/g/datastore> releasetool start --language python                                                                                                                                                     master?
o/ Hey, crwilcox, let's release some stuff!
> Determining GitHub context.
Origin: googleapis/google-cloud-python, Upstream: googleapis/google-cloud-python
> Comparing origin/master to master.
master is up to date with origin/master
> Figuring out the package name.
Looks like we're releasing datastore.
> Figuring out what the last release was.
From github.com:googleapis/google-cloud-python
 * [new branch]            release-datastore-2018.10.29 -> origin/release-datastore-2018.10.29
The last release was 1.7.0.
> Gathering changes since 1.7.0
Cool, 9 changes found.
> Opening your editor to finalize release notes.
Releasing 2018.10.29.
> Creating branch release-datastore-2018.10.29
fatal: A branch named 'release-datastore-2018.10.29' already exists.
Traceback (most recent call last):
  File "/Users/crwilcox/workspace/releasetool/venv/bin/releasetool", line 11, in <module>
    sys.exit(main())
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/releasetool/main.py", line 101, in start
    return releasetool.commands.start.python.start()
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/releasetool/commands/start/python.py", line 198, in start
    create_release_branch(ctx)
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/releasetool/commands/start/python.py", line 130, in create_release_branch
    return releasetool.git.checkout_create_branch(ctx.release_branch)
  File "/Users/crwilcox/workspace/releasetool/venv/lib/python3.7/site-packages/releasetool/git.py", line 46, in checkout_create_branch
    subprocess.check_output(["git", "checkout", "-b", branch_name, base])
  File "/Users/crwilcox/.pyenv/versions/3.7.0/lib/python3.7/subprocess.py", line 376, in check_output
    **kwargs).stdout
  File "/Users/crwilcox/.pyenv/versions/3.7.0/lib/python3.7/subprocess.py", line 468, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'checkout', '-b', 'release-datastore-2018.10.29', 'master']' returned non-zero exit status 128.

Crash on nodejs repo with no samples directory

It looks like we always expect a samples repo for node.js releases. That's not always going to be the case, so it would be nice if we were flexible enough to deal with that :)

> Committing changes
fatal: pathspec 'samples/package.json' did not match any files
Traceback (most recent call last):
  File "/Users/beckwith/Library/Python/3.6/bin/releasetool", line 11, in <module>
    sys.exit(main())
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/releasetool/__main__.py", line 106, in start
    return releasetool.commands.start.nodejs.start()
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/releasetool/commands/start/nodejs.py", line 214, in start
    create_release_commit(ctx)
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/releasetool/commands/start/nodejs.py", line 173, in create_release_commit
    f"Release v{ctx.release_version}",
  File "/Users/beckwith/Library/Python/3.6/lib/python/site-packages/releasetool/git.py", line 51, in commit
    subprocess.check_output(["git", "add"] + list(files))
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'add', 'CHANGELOG.md', 'package.json', 'samples/package.json']' returned non-zero exit status 128.

Java: Cannot separate the version bump and replacement

Use case: customizing a release artifact version (e.g. Spanner GA)

  1. We want to run releasetool start, bump all versions for a minor release in the versions.txt manifest.
  2. We want to skip replacing versions.
  3. We manually update the version of the major client.
  4. We run releasetool start, but not update the versions.txt manifest.
  5. Continue with the remaining steps.

Even though we don't update versions.txt, we have bumped all the versions again in memory, so all versions are bumped twice. We should only bump versions if we are updating the versions.txt manifest.

Error caused by missing/uninitialized ctx.release_notes in Ruby start command

The Ruby start command now fails as shown below, apparently due to this change in #61.

The last release was 1.5.5.
> Gathering changes since 1.5.5
Cool, 1 changes found.
> Updating CHANGELOG.md.
> Now it's time to pick a release version!
Traceback (most recent call last):
  File "/Users/quartzmo/.pyenv/versions/3.6.6/bin/releasetool", line 11, in <module>
    load_entry_point('gcp-releasetool', 'console_scripts', 'releasetool')()
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/quartzmo/code/google/codez/releasetool/releasetool/main.py", line 60, in main
    return ctx.invoke(start)
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/quartzmo/code/google/codez/releasetool/releasetool/main.py", line 105, in start
    return releasetool.commands.start.ruby.start()
  File "/Users/quartzmo/code/google/codez/releasetool/releasetool/commands/start/ruby.py", line 197, in start
    determine_release_version(ctx)
  File "/Users/quartzmo/code/google/codez/releasetool/releasetool/commands/start/ruby.py", line 91, in determine_release_version
    release_notes = textwrap.indent(ctx.release_notes, "\t")
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/textwrap.py", line 482, in indent
    return ''.join(prefixed_lines())
  File "/Users/quartzmo/.pyenv/versions/3.6.6/lib/python3.6/textwrap.py", line 480, in prefixed_lines
    for line in text.splitlines(True):
AttributeError: 'NoneType' object has no attribute 'splitlines'

I can submit a PR to fix this today.

Go release missing several commits

Environment details

  • OS: osx
  • Python version: 3.6.5
  • releasetool version: 2018.11.7.2

Problem

  1. releasetool start --language go

Should generate a CHANGES.md with:

$ git log v0.33.1..HEAD --format=format:%H
f5990a4292826db021c86aa413b5149cc714a78f
3b9ae547b3d80df7227c0e71bc60c86aee8c4b89
48f90e82b521609d016f2b99269f38fc9489bcc3
022eb1645b78acb655755a0c1e185c68cd5c8eb3
56d3f5bc07d0a73b6643844c715d22ff2d097797
90772c0662468af35837da2bb1759d8ec897c69c
41590e5e6d7a5a30921e686fbc57c45545d8bf29
20d48165e15edb94128d2907ed8c9c8b2ae0a360
2a912322007f3a7f0b4e7e96ba0dfd8c4f347d33
977bdf6a60d16cd466ccbfe6c20bfc20ddf923ba

However, it gets generated with:

12-04-2018 16:21 PST

- functions: don't use a wrapper and make Resource a value
- functions/metadata: use JSON and pointers
- internal: run vet

aka:

f5990a4292826db021c86aa413b5149cc714a78f
3b9ae547b3d80df7227c0e71bc60c86aee8c4b89
48f90e82b521609d016f2b99269f38fc9489bcc3

Autoselect language in `releasetool tag`

releasetool start is picking the language for us automagically, which is good. It seems like its trying to the same for releasetool tag, but still makes me enter through a prompt:

nodejs-logging (release-nodejs-logging-v3.0.2) $ releasetool tag
Which language (python, python-tool, nodejs, java)? [nodejs]:
o/ Hey, beckwith, let's tag a release!
> Determining GitHub context.
Origin: JustinBeckwith/nodejs-logging, Upstream: googleapis/nodejs-logging

It would be rad to have it just do 'the right thing' automatically without me needing to return through :)

Errors using start command in Ruby project

I attempted to use releasetool today in google-cloud-datastore, which has a few pending changes. I tried both the python and nodejs options. The python support produces a correct changelog, but then errors in determine_release_version. The nodejs option produces an incorrect and exceptionally long changelog, but then prompts for a manual entry of the new version, which brings it further. It updates the local CHANGELOG.md, then errors with: No such file or directory: 'package.json'.

(I'm trying to figure out how to execute my local clone of the repo so that I can work toward a solution, if you can offer any pointers. I've tried following the instructions for setuptools development-mode but I can't seem to execute the local code, only the executable that I installed per the readme.)

/cc @JustinBeckwith @blowmage @dazuma

Using the python support:

Chriss-iMac:google-cloud-datastore quartzmo$ releasetool start
Which language (python, python-tool, nodejs)?: python 
o/ Hey, quartzmo, let's release some stuff!
> Determining basic context.
GitHub Repo: GoogleCloudPlatform/google-cloud-ruby
> Figuring out the package name.
Looks like we're releasing google-cloud-datastore.
> Figuring out what the last release was.
The last release was datastore/v1.4.0.
> Gathering changes since datastore/v1.4.0
Cool, 6 changes found.
> Opening your editor to finalize release notes.
> Now it's time to pick a release version!
Here's the release notes you wrote:

	- Reduce string memory usage (#2174)
	- Remove yard-doctest autoloading (#2133)
	- Fix YARD build in Ruby 2.0.0 (#2125)
	- Add documentation for enabling gRPC logging
	- Update versioning info on documentation
	- Document and check for unsupported Ruby versions (#1988)

	### Implementation Changes

	### New Features

	### Dependencies

	### Documentation

	### Internal / Testing Changes

Traceback (most recent call last):
  File "/usr/local/bin/releasetool", line 11, in <module>
    load_entry_point('gcp-releasetool', 'console_scripts', 'releasetool')()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/releasetool/main.py", line 43, in start
    return releasetool.commands.start.python.start()
  File "/usr/local/lib/python3.6/site-packages/releasetool/commands/start/python.py", line 225, in start
    determine_release_version(ctx)
  File "/usr/local/lib/python3.6/site-packages/releasetool/commands/start/python.py", line 122, in determine_release_version
    parsed_version = [int(x) for x in ctx.last_release_version.split('.')]
  File "/usr/local/lib/python3.6/site-packages/releasetool/commands/start/python.py", line 122, in <listcomp>
    parsed_version = [int(x) for x in ctx.last_release_version.split('.')]
ValueError: invalid literal for int() with base 10: 'datastore/v1'

And using the nodejs support:

Chriss-iMac:google-cloud-datastore quartzmo$ releasetool start
Which language (python, python-tool, nodejs)?: nodejs
o/ Hey, quartzmo, let's release some stuff!
> Determining basic context.
GitHub Repo: GoogleCloudPlatform/google-cloud-ruby
> Figuring out the package name.
Looks like we're releasing google-cloud-datastore.
> Figuring out what the last release was.
The last release was 0.20.0.
> Gathering changes since 0.20.0
Cool, 155 changes found.
> Opening your editor to finalize release notes.
> Now it's time to pick a release version!
Here's the release notes you wrote:

	- Reduce string memory usage (#2174)
	- Remove yard-doctest autoloading (#2133)
	- Fix YARD build in Ruby 2.0.0 (#2125)
	- Add documentation for enabling gRPC logging
	- Update versioning info on documentation
	- Document and check for unsupported Ruby versions (#1988)
	- Release Datastore 1.4.0
	- Release google-cloud-core 1.2.0
	- Apply jwt fix to all Gemfiles
	- Update Entity code example
	- Restore a bunch of allow_nils for deferred config values (#1941)
	- Update Datastore config defaults
	- Move configure method so it will be documented
	- Fix bug with query results using offset
	- Default credential configurations
	- Simplify some config logic by using aliases and defaults
	- Update config class to use BasicObject and provide validations
	- Add Datastore configuration support
	- Downgrade Rubocop
	- Update Datastore code style
	- Bump Rubocop to recent version
	- Fix acceptance test env var order
	- Update authentication documentation
	- Release google-cloud-datastore 1.3.0
	- Update Apache Licence URL
	- Update copyright header format
	- Merge pull request #1881 from geigerj/video-ga
	- Add Dataset#transaction deadline argument
	- Add Dataset#transaction automatic retry
	- Loosen version bound
	- Bump remaining GAX deps
	- Add previous_transaction option and Dataset#read_only_transaction
	- Resolve Datastore assert nil warnings
	- Release Datastore 1.2.1
	- Remove warning when using Datastore Emulator
	- Release Datastore 1.2.0
	- Skip all Credentials doctests
	- Release google-cloud-core 1.1.0
	- Fix error test for Ruby 2.0
	- Add Google::Cloud::Error#cause
	- Bump google-gax dependency
	- Bump google-gax dependency
	- Add Credentials to Datastore
	- Bump GAX dependencies
	- Global GAPIC refresh (#1804)
	- Fix Build
	- Update to latest google-protobuf
	- Update READMEs for GA libraries
	- Release google-cloud-datastore 1.1.0
	- Merge pull request #1578 from blowmage/coverage-filters
	- Add coverage filters for Datastore
	- Fix bad retry configuration
	- Update gem spec homepage links
	- Release Datastore 1.0.1
	- Pin google-protouf dependency
	- Release Datastore 1.0.0
	- Release google-cloud-core 1.0.0
	- Merge pull request #1376 from blowmage/ga-1.0-prep
	- Switch to google-cloud-env
	- Merge pull request #1372 from blowmage/readme-latest
	- Merge pull request #1375 from quartzmo/integration-test-support
	- Add rake task acceptance:unsafe
	- Update documentation URLs
	- Update Datastore examples
	- Update Datastore query docs
	- Update Datastore docs
	- Merge pull request #1332 from swcloud/gapic-codegen-update-retry-param
	- Update GAPIC retry code for non_idempotent calls of all APIs
	- Update Datastore docs examples
	- Release Datastore 0.24.2
	- Update headers to use generated ruby version.
	- Release Datastore 0.24.1
	- Merge pull request #1269 from landrito/datastore
	- Use lib_name/lib_version
	- Regenerate datastore.
	- Update jsondoc tasks
	- Release Datastore 0.24.0
	- Generate GAPIC Data Types docs TOC for Datastore
	- Upgrade google-gax dependency
	- Fix acceptance test output
	- Update minitest dependency
	- Merge pull request #1242 from swcloud/fix-retry-codes-in-client-config-json
	- Fix retry codes in client config json for all gapic API
	- Upgrade google-gax dependency
	- Merge pull request #1221 from blowmage/refactor-grpc-utils
	- Add tests for Datastore emulator_host
	- Add Datastore Convert module
	- Datastore.new accepts emulator_host params
	- Pin yard-doctest version to 0.1.8
	- Update toc.json for google-cloud and google-cloud-datastore
	- Add data types links to docs for Google::Datastore::V1
	- Update Datastore toc.json
	- Exclude undocumented GAPIC Datastore code from YARD
	- Pin rainbow and nokogiri gems to known good versions
	- Add try_with_backoff to Datastore acceptance tests
	- Add Datastore GRPCUtils
	- Update rake doctest tasks
	- Update yard-doctest mocking
	- Update File stub in doctest helper
	- Add yard autoload_plugins before doctest
	- Release BigQuery, Datastore, Logging, and Storage 0.23.0 (beta)
	- Update Datastore GAPIC types in docs site
	- Add Datastore GAPIC types to docs site
	- Include Datastore GAPIC/gRPC code in YARD docs
	- Add yard-doctest testing to Datastore
	- Pin Rake at version ~> 11.0
	- Use new GAPIC naming
	- Change api suffix from Api to Client
	- Merge pull request #1016 from swcloud/gapic-grpcdocgen-datastore
	- Add prefix to Datastore acceptance tests
	- Add ci:acceptance tasks to service gems
	- Add google-cloud-datastore ci task
	- Add require boilerplate to Datastore examples
	- Upgrade yard-doctest to v0.1.8
	- Add grpc dummy documentation class for datastore API
	- Merge pull request #1001 from blowmage/add-foolish-consistency
	- Temporarilly pin doctest dependency
	- Add empty doctest task to all gems
	- Add README and LICENSE to gem packages
	- Ensure Gemfiles use HTTPS
	- Created integration tests for Logging and Error Reporting against GAE and GKE
	- Update gapic code using hash object to pass in both required and optional parameters
	- Release Datastore v0.21.0
	- Merge pull request #984 from blowmage/google-gax-0.6
	- Add Datastore properties support for symbols
	- Update all versions to 0.21.0
	- Update google-gax to latest version
	- * Add back work-around for Hash to Map conversion * Remove require for protobuf classes in v[x].rb
	- Fix import for all GAPIC APIs
	- Merge pull request #975 from blowmage/grpc-project-metadata
	- Add Datastore resource-prefix header
	- Revert User Agent to gcloud-ruby
	- Rename Google::Cloud::Core::GCE to Google::Cloud::Core::Environment
	- Add GAX client_config to Datastore service factory
	- Update Datastore retries documentation
	- Convert Datastore to GAX
	- Rename Service#datastore and Service#mocked_datastore
	- Update README files to use new factory methods
	- Add Datastore.new factory method
	- Merge pull request #946 from quartzmo/stackoverflow
	- Update jsondoc task in gem Rakefiles
	- Update StackOverflow tag in docs
	- Update vkit generated code for datastore
	- Switch acceptance tests to use JSON ENV VARS
	- Add doctest rake tasks
	- Add yard-doctest dependency to all gems
	- Add GRPC require to error handling code
	- Merge pull request #894 from blowmage/fix-datastore-file-binmode-tests
	- Resolve merge conflicts
	- Possible fix for unit tests running on Windows
	- Regenerate files for delay loading grpc module.
	- Add Datastore Gapic files.
	- Bump for release
	- Delay loading GRPC until its used
	- Update README links to API docs

	### Implementation Changes

	### New Features

	### Dependencies

	### Documentation

	### Internal / Testing Changes

Is this a major, minor, or patch update (or enter the new version directly): 1.5.0
> Creating branch release-google-cloud-datastore-v1.5.0
Switched to a new branch 'release-google-cloud-datastore-v1.5.0'
> Updating CHANGELOG.md.
> Updating package.json.
Traceback (most recent call last):
  File "/usr/local/bin/releasetool", line 11, in <module>
    load_entry_point('gcp-releasetool', 'console_scripts', 'releasetool')()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/releasetool/main.py", line 47, in start
    return releasetool.commands.start.nodejs.start()
  File "/usr/local/lib/python3.6/site-packages/releasetool/commands/start/nodejs.py", line 227, in start
    update_package_json(ctx)
  File "/usr/local/lib/python3.6/site-packages/releasetool/commands/start/nodejs.py", line 183, in update_package_json
    f'"version": "{ctx.release_version}"')
  File "/usr/local/lib/python3.6/site-packages/releasetool/filehelpers.py", line 76, in replace
    with open(filename, 'r+') as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'package.json'

Node.js not supported?

I decided to give this a shot, to help me release a library.

  • Installation: Even for someone who doesn't grok Python, the installation instructions worked flawlessly on my mac 🎉.
  • releasetool start:
❯ releasetool start
Which language (python, python-tool)?: nodejs
Error: invalid choice: nodejs. (choose from python, python-tool)

Do I need the master branch, etc. for Node.js support?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.