Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Artman Refactor #159

Merged
merged 47 commits into from Apr 18, 2017
Merged

Artman Refactor #159

merged 47 commits into from Apr 18, 2017

Conversation

lukesneeringer
Copy link
Contributor

@lukesneeringer lukesneeringer commented Apr 17, 2017

This PR constitutes a significant refactor of Artman:

  • New install mechanism: pip install googleapis-artman
  • New shell command: artman
  • User-level configuration available: ~/.artman/config.yaml
  • New shorthand to specify an API: --api=pubsub
  • New shorthand to specify an alternative googleapis directory:
    --googleapis=~/Code/Google/googleapis-private
  • Pluggable publishers (--publish)
  • New GitHub publisher automatically makes a pull request (--publish=github)
  • Default pipeline is now GapicClientPipeline; you can specify one with --pipeline.
  • Many, many more unit tests.

Note that it is not rebased into a single commit due to merge conflicts. It will be squashed into a single commit on merge.

README.rst Outdated
artman build --api pubsub --language python

This assumes that you have checkouts of both `googleapis`_ and `toolkit`_
on your system (and that toolkit is able to run; e.g. you need Java).

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


# Ask the user for a repository root.
while not answer.get('reporoot'):
logger.info('First, we need to know where you store most code on your '

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@lukesneeringer lukesneeringer self-assigned this Apr 17, 2017

def get_validate_kwargs(self):
return ['gapic_api_yaml', 'final_repo_dir'] + code_gen.COMMON_REQUIRED
return ['gapic_api_yaml', 'gapic_code_dir'] + code_gen.COMMON_REQUIRED

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@ethanbao ethanbao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome change! Consider converting current BlobUploadTask (https://github.com/googleapis/artman/blob/master/pipeline/tasks/io_tasks.py#L35) into another publish type in a follow-up PR. We can use application default credential for auth.

# See the License for the specific language governing permissions and
# limitations under the License.

"""Pipelines that run GAPIC"""

This comment was marked as spam.

@@ -0,0 +1,164 @@
# Copyright 2016 Google Inc. All Rights Reserved.

This comment was marked as spam.

This comment was marked as spam.

repo_dest = '%s/%s' % (api_repo, git_repo.get('gapic_subpath', '.'))
component = git_repo.get('gapic_component', '.')
src_path = os.path.abspath(os.path.join(gapic_code_dir, component))
self.exec_command(['rm', '-rf', repo_dest])

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -0,0 +1,114 @@
# Copyright 2016 Google Inc. All Rights Reserved.

This comment was marked as spam.

This comment was marked as spam.

@@ -0,0 +1,86 @@
# Copyright 2017 Google

This comment was marked as spam.

This comment was marked as spam.

@@ -0,0 +1,353 @@
# Copyright 2016 Google Inc. All Rights Reserved.

This comment was marked as spam.

@@ -0,0 +1,30 @@
common:
toolkit_path: ${REPOROOT}/toolkit
staging_repo_dir: ${REPOROOT}/api-client-staging/generated

This comment was marked as spam.

@lukesneeringer
Copy link
Contributor Author

lukesneeringer commented Apr 18, 2017

Awesome change! Consider converting current BlobUploadTask into another publish type in a follow-up PR. We can use application default credential for auth.

I like that idea. Definitely should be a follow-up though.

Copy link
Contributor

@geigerj geigerj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From skimming the change, generally looks good to me. (No need to block on my full review if @michaelbausor and @ethanbao are both happy.)

grpc_code_dir (str): The current GRPC code location, if any.
"""
userhome = os.path.expanduser('~')
gapic_loc = os.path.realpath(gapic_code_dir).replace(userhome, '~')

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Luke Sneeringer added 3 commits April 18, 2017 11:01
Copy link
Contributor

@michaelbausor michaelbausor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one nit. We should update USAGE.rst as well

README.rst Outdated

.. code::

artman build --api pubsub --language python

This comment was marked as spam.

cd ~/hack-on-artman
tox -e devenv
sudo pip install virtualenv virtualenvwrapper
mkvirtualenv --python=`which python3` artman

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@ethanbao ethanbao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

repo_dest = '%s/%s' % (api_repo, git_repo.get('gapic_subpath', '.'))
component = git_repo.get('gapic_component', '.')
src_path = os.path.abspath(os.path.join(gapic_code_dir, component))
self.exec_command(['rm', '-rf', repo_dest])

This comment was marked as spam.

@lukesneeringer
Copy link
Contributor Author

We can provide a better solution later. The reason I was asking is that the local output (which might include manual changes) can be wiped out and replaced without consent.

I should probably make --publish=noop more publicly documented.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants