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

Add read-file action #203

Merged
merged 43 commits into from
Jan 24, 2025
Merged

Add read-file action #203

merged 43 commits into from
Jan 24, 2025

Conversation

kenodegard
Copy link
Contributor

@kenodegard kenodegard commented Aug 16, 2024

Description

Depends on #243

Adding a read-file action that will support reading a local or remote file and supports both JSON and Yaml but will also allow leaving the output as a plain string.

This action replaces read-yaml.

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 16, 2024
Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

Nice!

jezdez
jezdez previously approved these changes Aug 27, 2024
@kenodegard kenodegard marked this pull request as ready for review December 17, 2024 19:42
@kenodegard kenodegard requested a review from a team as a code owner December 17, 2024 19:42
@kenodegard kenodegard mentioned this pull request Jan 9, 2025
read-file/read_file.py Outdated Show resolved Hide resolved
@kenodegard kenodegard marked this pull request as ready for review January 10, 2025 15:56
Comment on lines +84 to +85
assert '''${{ steps.json.outputs.content }}''' == '''${{ steps.yaml.outputs.content }}'''
assert '''${{ fromJSON(steps.json.outputs.content)['foo'] }}''' == '''${{ fromJSON(steps.yaml.outputs.content)['foo'] }}'''
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to use triple single quotes here and not single double quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the json values might contain quotes at some point in the future 🤷🏼‍♂️

Run a test server on a random port. Inspect returned server to get port,
shutdown etc.

See https://github.com/conda/conda/blob/52b6393d6331e8aa36b2e23ab65766a980f381d2/tests/http_test_server.py
Copy link
Member

Choose a reason for hiding this comment

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

Have we copied this fixture enough around that it would be useful to have it on PyPI as a pytest extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK this is only the second place and idk how much we'd benefit from standardizing this further, this has deviated quite a bit from what was copied

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I miss remembered, this fixture is almost identical to the one in conda

@jezdez jezdez enabled auto-merge (squash) January 24, 2025 09:38
@jezdez jezdez disabled auto-merge January 24, 2025 09:52
@jezdez jezdez merged commit c01236b into main Jan 24, 2025
6 checks passed
@jezdez jezdez deleted the read-file branch January 24, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Status: 🏁 Done
Development

Successfully merging this pull request may close these issues.

3 participants