Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

circleci learned orb source #35

Merged
merged 1 commit into from
Jul 27, 2018
Merged

circleci learned orb source #35

merged 1 commit into from
Jul 27, 2018

Conversation

marcomorain
Copy link
Contributor

circleci orb source circleci/gradle will print the source of the
gradle orb.

`circleci orb source circleci/gradle` will print the source of the
gradle orb.
@codecov-io
Copy link

codecov-io commented Jul 27, 2018

Codecov Report

Merging #35 into master will decrease coverage by 0.07%.
The diff coverage is 70.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
- Coverage   38.76%   38.68%   -0.08%     
==========================================
  Files          12       12              
  Lines         841      853      +12     
==========================================
+ Hits          326      330       +4     
- Misses        491      499       +8     
  Partials       24       24
Impacted Files Coverage Δ
cmd/orb.go 27.3% <70.96%> (+0.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1531996...3418989. Read the comment docs.

Copy link
Contributor

@eric-hu eric-hu left a comment

Choose a reason for hiding this comment

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

$ go run main.go orb source circleci/gradle
executor:
  gradle:
    description: The docker container to use when running Gradle builds
    docker:
      - image: circleci/openjdk:8-jdk-node
    environment:
      # Disable fancy terminal updates
      TERM: dumb

commands:
  with_cache:
    description: |
      Run a set of steps with gradle dependencies cached.

      This command will first restore a cache of gradle dependencies, if one was
      saved by a previous build. The provided `steps` will then be executed, and
      if successful, then a fresh cache will be saved, if required.

      The contents of the `~/.gradle` directory is cached, which will substantially
      improve build times for projects with many dependencies.

      The cache-key is generated from any files named `build.gradle` that are
      present in the `working_directory`.
    parameters:
      steps:
        type: steps
    steps:
      - run:
          name: Generate Cache Checksum
          command: find . -name 'build.gradle' -exec cat {} + | shasum | awk '{print $1}' > /tmp/gradle_cache_seed
      - restore_cache:
          key: gradle-{{ checksum "/tmp/gradle_cache_seed" }}
      - << parameters.steps >>
      - save_cache:
          paths:
            - ~/.gradle
          key: gradle-{{ checksum "/tmp/gradle_cache_seed" }}

jobs:
  test:
    description: |
      Checkout, build and test a gradle project.
    executor: gradle
    parameters:
      test_command:
        type: string
        default: test
    steps:
      - checkout
      - with_cache:
          steps:
            - run:
                name: Run Tests
                command: ./gradlew << parameters.test_command >>
$ go run main.go orb source circleci/gradl
Error: Failed to get source for 'circleci/gradl': graphql: Non-nullable field was null.
exit status 255

This is looking good!

I think we should wrap the graphql error in the CLI. That response makes a user error look like a server error.

@marcomorain
Copy link
Contributor Author

This is a server error as far as I can tell.

@eric-hu
Copy link
Contributor

eric-hu commented Jul 27, 2018

I'll make a follow up ticket for this. LGTM

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

Successfully merging this pull request may close these issues.

3 participants