Skip to content

Conversation

@dhermes
Copy link
Contributor

@dhermes dhermes commented May 17, 2016

See, for example: https://travis-ci.org/GoogleCloudPlatform/gcloud-python/builds/128927443

The ID string was made so that gcloud-py-{TIME}-{BUILD_ID} (e.g. gcloud-py-1462819431-128927443) was 30 chars. However, one of the test cases appended -a to test out creating a different cluster and 32 chars is not allowed for cluster names.

@dhermes dhermes added testing api: bigtable Issues related to the Bigtable API. labels May 17, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 17, 2016
@tseaver
Copy link
Contributor

tseaver commented May 17, 2016

Seems like we might be truncating the bits of the ID which would provide the most uniqueness (e.g., two Travis builds running simultaneously have the same time.time() seconds, and differ only in the last byte of the TRAVIS_BUILD_ID. Perhaps we should have unique_resource_id take a prefix argument and an optional max_length, and work out which bits to trim?

@dhermes
Copy link
Contributor Author

dhermes commented May 17, 2016

I don't think it's worth the effort. It's essentially impossible to end up with the same timestamp (it's YAGNI).

@tseaver
Copy link
Contributor

tseaver commented May 17, 2016

The version with TRAVIS_BUILD_ID in it truncates time.time() to an integer: if it is always unique, why do we need the TRAVIS_BUILD_ID at all?

@dhermes
Copy link
Contributor Author

dhermes commented May 17, 2016

why do we need the TRAVIS_BUILD_ID at all?

So we can track down the guilty build if we see un-cleaned up resources in the cloud console.

@tseaver
Copy link
Contributor

tseaver commented May 17, 2016

Won't that usecase be broken if we truncate off bytes from the build ID?

@dhermes
Copy link
Contributor Author

dhermes commented May 17, 2016

Ha! Touche. Easiest fix: I'll swap the order of BUILD ID and time. Anyhow, as it is there, the ID will be

>>>  len('gcloud-128927443-1462819431')
27
>>> len('new-128927443-1462819431')
24

so hopefully nothing will get truncated.

WDYT of just doing the swap?

@tseaver
Copy link
Contributor

tseaver commented May 17, 2016

WDYT of just doing the swap?

SGTM

@dhermes
Copy link
Contributor Author

dhermes commented May 17, 2016

@tseaver PTAL

@tseaver
Copy link
Contributor

tseaver commented May 17, 2016

LGTM

@dhermes dhermes merged commit 763a90c into googleapis:master May 17, 2016
@dhermes dhermes deleted the limit-cluster-id-names-in-sys-tests branch May 17, 2016 21:06
@dhermes dhermes mentioned this pull request Jun 7, 2016
parthea added a commit that referenced this pull request Nov 24, 2025
parthea pushed a commit that referenced this pull request Nov 26, 2025
* docs: update README to include x509 feature.

* Fix hyperlink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API. cla: yes This human has signed the Contributor License Agreement. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants