-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: Changes to metadata files #20
Changes from all commits
e49360d
dec6989
df9b163
c724fad
7fe2816
02ed673
d42f470
fb634ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ description = "Moves or renames a file inside a storage bucket. Not suitable to | |
standalone = true | ||
deprecated = false | ||
# What kinds of preconditions needs to be met. Natural language. (optional) | ||
requirements = "The bucket and the file must exist. User needs to have write permission to the bucket." | ||
requirements_desc = "The bucket and the file must exist. User needs to have write permission to the bucket." | ||
# What will happen when the code sample in the region tag gets executed. Natural Language. (optional) | ||
effects = "File is moved/renamed." | ||
effects_desc = "File is moved/renamed." | ||
|
||
[requirements] | ||
# List of services that need to be enabled for the sample (and tests) to work. | ||
|
@@ -62,12 +62,12 @@ terraform = ["tf/storage_move_file/single_bucket_move.tf"] | |
command = "gsutil ls gs://$BUCKET_NAME/ | grep $NEW_FILE_NAME" | ||
|
||
[tests.cleanup] | ||
# Make sure the template is deleted. If the command can fail, use `|| true` to supress the failure. | ||
# In this case, it WILL fail, if the test was successful, so we want to ignore this failure. | ||
# Make sure the file is deleted. If the command can fail, use `|| true` to supress the failure. | ||
# Since Terraform was used to set up the environment, it will be automatically used to clean up using | ||
# `terraform destroy`. However, since some resources might not longer be under Terraform control, we have an option to | ||
# `terraform destroy`. However, since some resources might no longer be under Terraform control, we have an option to | ||
# execute some commands before `terraform destroy` takes place. | ||
commands = ["gsutil rm -f gs://$BUCKET_NAME/$NEW_FILE_NAME"] | ||
|
||
commands = ["gsutil rm -f gs://$BUCKET_NAME/$NEW_FILE_NAME || true"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes sense for prototype, it might be good to move the error suppression into a separate setting, maybe a "warnOnFailure" that would allow the tool to suppress the error but still log as part of the tool's UX that something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could work when we have only one command, but if there are multiple commands and we want to ignore error for only some of them, it gets more complicated. Definitely something to consider if this gets to evolve to full project. |
||
|
||
[tests.python] | ||
# We can specify which versions of a language we want to test against. | ||
|
@@ -79,7 +79,7 @@ method = "move_blob" | |
# Parameters can be strings, integers and floats. Define appropriate value in TOML - it supports ints and floats! | ||
parameters = ["$BUCKET_NAME", "$FILE_NAME", "$BUCKET_NAME", "$NEW_FILE_NAME"] | ||
# Those packages will be installed before executing the Python sample. | ||
requirements = "../python/templates/requirements.txt" | ||
requirements = "../python/requirements.txt" | ||
|
||
[tests.java] | ||
versions = ["11", "17", "21"] | ||
|
@@ -115,15 +115,15 @@ terraform = ["tf/storage_move_file/move_between_buckets.tf"] | |
command = "gsutil ls gs://$NEW_BUCKET_NAME/ | grep $NEW_FILE_NAME" | ||
|
||
[tests.cleanup] | ||
commands = ["gsutil rm -f gs://$NEW_BUCKET_NAME/$NEW_FILE_NAME"] | ||
commands = ["gsutil rm -f gs://$NEW_BUCKET_NAME/$NEW_FILE_NAME || true"] | ||
|
||
[tests.python] | ||
versions = ["3.8", "3.12"] | ||
legacy = false | ||
file = "../python/storage_move_file.py" | ||
method = "move_blob" | ||
parameters = ["$BUCKET_NAME", "$FILE_NAME", "$NEW_BUCKET_NAME", "$NEW_FILE_NAME"] | ||
requirements = "../python/templates/requirements.txt" | ||
requirements = "../python/requirements.txt" | ||
|
||
[tests.java] | ||
versions = ["11", "17", "21"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is _desc meant to clarify that it's a string value? Are these values separately used in the tool? If not maybe they should be combined? Or perhaps requirements_desc could be moved as requirements.description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _desc suffix is there, because right after this we have a section
[requirements]
and the names collide. So I quickly added the _desc suffix to requirements fields. I added the suffix to effects as well for consistency.