Code Monkey home page Code Monkey logo

nodejs-artifact-registry's Introduction

Google Cloud Platform logo

THIS REPOSITORY HAS BEEN ARCHIVED. ALL OF ITS CONTENT AND HISTORY HAS BEEN MOVED TO GOOGLE-CLOUD-NODE

release level npm version

Artifactregistry client for Node.js

A comprehensive list of changes in each version may be found in the CHANGELOG.

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Before you begin

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Artifact Registry API.
  4. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install @google-cloud/artifact-registry

Using the client library

// Imports the Google Cloud client library

// remove this line after package is released
// eslint-disable-next-line node/no-missing-require
const {ArtifactRegistryClient} = require('@google-cloud/artifact-registry');

// TODO(developer): replace with your prefered project ID.
// const projectId = 'my-project'

// Creates a client
const client = new ArtifactRegistryClient();

//TODO(library generator): write the actual function you will be testing
async function listsRepositories() {
  const repositories = await client.listRepositories({
    parent: `projects/${projectId}/locations/${location}`,
  });
  console.info(repositories);
}
listsRepositories();

Samples

Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.

Sample Source Code Try it
Quickstart source code Open in Cloud Shell

The Artifact Registry Node.js Client API Reference documentation also contains samples.

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.

Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:

  • Legacy versions are not tested in continuous integration.
  • Some security patches and features cannot be backported.
  • Dependencies cannot be kept up-to-date.

Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm dist-tags. The dist-tags follow the naming convention legacy-(version). For example, npm install @google-cloud/artifact-registry@legacy-8 installs client libraries for versions compatible with Node.js 8.

Versioning

This library follows Semantic Versioning.

This library is considered to be stable. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against stable libraries are addressed with the highest priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

Please note that this README.md, the samples/README.md, and a variety of configuration files in this repository (including .nycrc and tsconfig.json) are generated from a central template. To edit one of these files, make an edit to its templates in directory.

License

Apache Version 2.0

See LICENSE

nodejs-artifact-registry's People

Contributors

alexander-fenster avatar averikitsch avatar bcoe avatar dinagraves avatar fhinkel avatar gcf-owl-bot[bot] avatar google-cloud-policy-bot[bot] avatar justinbeckwith avatar parthea avatar release-please[bot] avatar renovate-bot avatar sofisl avatar surferjeffatgoogle avatar yoshi-automation avatar

Stargazers

 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

nodejs-artifact-registry's Issues

GA release of @google-cloud/artifact-registry

Package name: @google-cloud/artifact-registry
Current release: BETA
Proposed release: GA

Instructions

Check the lists below, adding tests / documentation as required. Once all the "required" boxes are ticked, please create a release and close this issue.

Required

  • 28 days elapsed since last beta release with new API surface
  • Server API is GA
  • Package API is stable, and we can commit to backward compatibility
  • All dependencies are GA

Optional

  • Most common / important scenarios have descriptive samples
  • Public manual methods have at least one usage sample each (excluding overloads)
  • Per-API README includes a full description of the API
  • Per-API README contains at least one “getting started” sample using the most common API scenario
  • Manual code has been reviewed by API producer
  • Manual code has been reviewed by a DPE responsible for samples
  • 'Client Libraries' page is added to the product documentation in 'APIs & Reference' section of the product's documentation on Cloud Site

📦 pack-n-play test: JavaScript code failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: d26e985
buildURL: Build Status, Sponge
status: failed

Test output
Process 249 exited with code 1.
Error: Process 249 exited with code 1.
    at ChildProcess. (node_modules/pack-n-play/build/src/utils.js:48:22)
        -> /workspace/node_modules/pack-n-play/src/utils.ts:62:11
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

v1.listDockerImages provides error response RESOURCE_PROJECT_INVALID

  • What you're trying to do

The equivalent of the following gcloud CLI command (which works):

gcloud artifacts docker images list us-east1-dkrimgs.pkg.dev/dev-infrastructure/images-v1 --format=json --include-tags

using the v1.listDockerImages() method. I'd also like to have it include the 'tags' (not sure how exactly to get that flag passed down, if needed, as docs and examples that I've seen are not too helpful here).

  • What code you've already tried
import { v1 } from '@google-cloud/artifact-registry';

(async () => {

const client = new v1.ArtifactRegistryClient();
const stub = await client.initialize();

console.log('stub:');
console.dir(stub); // What looks like good results are visible as result of this

const projectId = await client.getProjectId();
console.log('projectId:', projectId); // good result is seen here (got it from the environment settings / client .json file, I guess)

const resp = await client.listDockerImages({
parent: 'us-east1-dkrimgs.pkg.dev/dev-infrastructure/images-v1'
});

// does not get here
})();
  • Any error messages you're getting
error: Error: 3 INVALID_ARGUMENT: Invalid resource field value in the request.
    at Object.callErrorFromStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
    at Object.onReceiveStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/client.js:189:52)
    at Object.onReceiveStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:365:141)
    at Object.onReceiveStatus (/app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
    at /app/.yarn/cache/@grpc-grpc-js-npm-1.6.7-2e10ef0dbb-2668b08c2e.zip/node_modules/@grpc/grpc-js/build/src/call-stream.js:187:78
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  code: 3,
  details: 'Invalid resource field value in the request.',
  metadata: Metadata {
    internalRepr: Map(3) {
      'grpc-server-stats-bin' => [Array],
      'google.rpc.errorinfo-bin' => [Array],
      'grpc-status-details-bin' => [Array]
    },
    options: {}
  },
  statusDetails: [
    ErrorInfo {
      metadata: [Object],
      reason: 'RESOURCE_PROJECT_INVALID',
      domain: 'googleapis.com'
    }
  ],
  reason: 'RESOURCE_PROJECT_INVALID',
  domain: 'googleapis.com',
  errorInfoMetadata: {
    method: 'google.devtools.artifactregistry.v1.ArtifactRegistry.ListDockerImages',
    service: 'artifactregistry.googleapis.com'
  }
}

All seems good until the .listDockerImages() is invoked.

From what I can see, I'm providing the 'parent' value in the request object, with exactly the same value there as what the gcloud CLI accepts without issue.

Node version is: 16.14.2
@google-cloud/artifact-registry module version: 1.3.0 (latest)

Assistance is appreciated!

📦 pack-n-play test: TypeScript code failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: d26e985
buildURL: Build Status, Sponge
status: failed

Test output
Process 189 exited with code 2.
Error: Process 189 exited with code 2.
    at ChildProcess. (node_modules/pack-n-play/build/src/utils.js:48:22)
        -> /workspace/node_modules/pack-n-play/src/utils.ts:62:11
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Your .repo-metadata.json file has a problem 🤒

You have a problem with your .repo-metadata.json file:

Result of scan 📈:

  • release_level must be equal to one of the allowed values in .repo-metadata.json

☝️ Once you address these problems, you can close this issue.

Need help?

  • Schema definition: lists valid options for each field.
  • API index: for gRPC libraries api_shortname should match the subdomain of an API's hostName.
  • Reach out to go/github-automation if you have any questions.

📦 pack-n-play test: TypeScript code failed

Note: #14 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: 4de4a7a
buildURL: Build Status, Sponge
status: failed

Test output
Process 189 exited with code 2.
Error: Process 189 exited with code 2.
    at ChildProcess. (node_modules/pack-n-play/build/src/utils.js:48:22)
        -> /workspace/node_modules/pack-n-play/src/utils.ts:62:11
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

Synthesis failed for nodejs-artifact-registry

Hello! Autosynth couldn't regenerate nodejs-artifact-registry. 💔

Here's the output from running synth.py:

DUCT.md
CONTRIBUTING.md
LICENSE
README.md
api-extractor.json
renovate.json
samples/README.md
2021-01-07 02:10:13,070 synthtool [DEBUG] > Post-processing GAPIC library...
DEBUG:synthtool:Post-processing GAPIC library...
2021-01-07 02:10:13,070 synthtool [DEBUG] > Installing dependencies...
DEBUG:synthtool:Installing dependencies...
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
npm WARN deprecated [email protected]: Use cheerio-select instead

> [email protected] postinstall /home/kbuilder/.cache/synthtool/nodejs-artifact-registry/node_modules/protobufjs
> node scripts/postinstall


> @google-cloud/[email protected] prepare /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> npm run compile-protos && npm run compile


> @google-cloud/[email protected] compile-protos /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> compileProtos src

installing semver@^7.1.2
installing tmp@^0.2.0
installing uglify-js@^3.7.7
installing escodegen@^2.0.0
installing estraverse@^5.1.0

> @google-cloud/[email protected] compile /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> tsc -p . && cp -r protos build/

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 605 packages from 765 contributors and audited 606 packages in 28.548s

76 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

2021-01-07 02:10:42,608 synthtool [DEBUG] > Running prelint...
DEBUG:synthtool:Running prelint...

> @google-cloud/[email protected] prelint /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> cd samples; npm link ../; npm i


> @google-cloud/[email protected] prepare /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> npm run compile-protos && npm run compile


> @google-cloud/[email protected] compile-protos /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> compileProtos src


> @google-cloud/[email protected] compile /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> tsc -p . && cp -r protos build/

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 606 packages in 15.495s

76 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

/home/kbuilder/.nvm/versions/node/v14.15.4/lib/node_modules/@google-cloud/artifact-registry -> /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
/home/kbuilder/.cache/synthtool/nodejs-artifact-registry/samples/node_modules/@google-cloud/artifact-registry -> /home/kbuilder/.nvm/versions/node/v14.15.4/lib/node_modules/@google-cloud/artifact-registry -> /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 138 packages from 118 contributors and audited 199 packages in 4.811s

76 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

2021-01-07 02:11:04,497 synthtool [DEBUG] > Running fix...
DEBUG:synthtool:Running fix...

> @google-cloud/[email protected] fix /home/kbuilder/.cache/synthtool/nodejs-artifact-registry
> gts fix

/home/kbuilder/.cache/synthtool/nodejs-artifact-registry/node_modules/meow/index.js:61
		throw new Error(`Flag keys may not contain '-': ${invalidFlags.join(', ')}`);
		^

Error: Flag keys may not contain '-': dry-run
    at validateOptions (/home/kbuilder/.cache/synthtool/nodejs-artifact-registry/node_modules/meow/index.js:61:9)
    at meow (/home/kbuilder/.cache/synthtool/nodejs-artifact-registry/node_modules/meow/index.js:136:2)
    at Object.<anonymous> (/home/kbuilder/.cache/synthtool/nodejs-artifact-registry/node_modules/gts/build/src/cli.js:30:13)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @google-cloud/[email protected] fix: `gts fix`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @google-cloud/[email protected] fix script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kbuilder/.npm/_logs/2021-01-07T10_11_05_102Z-debug.log
2021-01-07 02:11:05,111 synthtool [ERROR] > Failed executing npm run fix:

None
ERROR:synthtool:Failed executing npm run fix:

None
Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/synthtool/__main__.py", line 102, in <module>
    main()
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/tmpfs/src/github/synthtool/synthtool/__main__.py", line 94, in main
    spec.loader.exec_module(synth_module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/kbuilder/.cache/synthtool/nodejs-artifact-registry/synth.py", line 41, in <module>
    node.postprocess_gapic_library()
  File "/tmpfs/src/github/synthtool/synthtool/languages/node.py", line 194, in postprocess_gapic_library
    fix(hide_output=hide_output)
  File "/tmpfs/src/github/synthtool/synthtool/languages/node.py", line 179, in fix
    shell.run(["npm", "run", "fix"], hide_output=hide_output)
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 39, in run
    raise exc
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 33, in run
    encoding="utf-8",
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['npm', 'run', 'fix']' returned non-zero exit status 1.
2021-01-07 02:11:05,160 autosynth [ERROR] > Synthesis failed
2021-01-07 02:11:05,161 autosynth [DEBUG] > Running: git reset --hard HEAD
HEAD is now at 0c5f6eb chore: release 1.0.0 (#1)
2021-01-07 02:11:05,179 autosynth [DEBUG] > Running: git checkout autosynth
Switched to branch 'autosynth'
2021-01-07 02:11:05,199 autosynth [DEBUG] > Running: git clean -fdx
Removing __pycache__/
Removing build/
Removing node_modules/
Removing package-lock.json
Removing samples/node_modules/
Removing samples/package-lock.json
Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 354, in <module>
    main()
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 189, in main
    return _inner_main(temp_dir)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 334, in _inner_main
    commit_count = synthesize_loop(x, multiple_prs, change_pusher, synthesizer)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 65, in synthesize_loop
    has_changes = toolbox.synthesize_version_in_new_branch(synthesizer, youngest)
  File "/tmpfs/src/github/synthtool/autosynth/synth_toolbox.py", line 259, in synthesize_version_in_new_branch
    synthesizer.synthesize(synth_log_path, self.environ)
  File "/tmpfs/src/github/synthtool/autosynth/synthesizer.py", line 120, in synthesize
    synth_proc.check_returncode()  # Raise an exception.
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 389, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['/tmpfs/src/github/synthtool/env/bin/python3', '-m', 'synthtool', '--metadata', 'synth.metadata', 'synth.py', '--']' returned non-zero exit status 1.

Google internal developers can see the full log here.

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.