Skip to content

Correctly translate paths to local requirements.txt file in environment dependencies - #2736

Merged
andrewnester merged 7 commits into
mainfrom
fix/env-spec-local-requirements
Apr 22, 2025
Merged

Correctly translate paths to local requirements.txt file in environment dependencies#2736
andrewnester merged 7 commits into
mainfrom
fix/env-spec-local-requirements

Conversation

@andrewnester

Copy link
Copy Markdown
Contributor

Changes

Correctly translate paths to local requirement.txt file in environment dependencies

Why

At the moment we don't translate paths to requirements.txt files which makes it impossible to reference local path to such files in environment dependencies. This PR fixes this

 dependencies:
- -r ../requirements.txt

Tests

Added acceptance test

@pieternpietern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, thanks!

trace $CLI bundle validate

trace $CLI bundle deploy
trace jq -s '.[] | select(.path=="/api/2.2/jobs/create") | .body.environments' out.requests.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Q: do you assert on the request payload because it includes the expanded wheel path?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, exactly

Comment threadbundle/libraries/local_path.go Outdated
Comment threadbundle/libraries/local_path.go Outdated
Comment threadbundle/config/mutator/translate_paths.go Outdated
Comment threadbundle/libraries/local_path.go Outdated
Comment threadbundle/libraries/local_path.go
@pietern
pietern requested a review from CopilotApril 17, 2025 13:20
@pietern

Copy link
Copy Markdown
Contributor

(adding copilot to see if it corrects the typos)

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • acceptance/bundle/environments/dependencies/requirements.txt: Language not supported
  • acceptance/bundle/environments/dependencies/script: Language not supported

Comment threadbundle/libraries/local_path.go Outdated
Comment threadacceptance/bundle/environments/dependencies/output.txt
Comment threadbundle/libraries/local_path.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andrewnesterandrewnester changed the title Correctly translate paths to local requirement.txt file in environment dependenciesCorrectly translate paths to local requirements.txt file in environment dependenciesApr 22, 2025
dyn.AnyIndex(),
dyn.Key("spec"),
dyn.Key("dependencies"),
dyn.AnyIndex(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: NewPatternFromString("resources.jobs.*.environments[*].spec.dependencies[*]") is slightly more readable if #2734 lands first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Btw, all patterns in this path visitor package can be rewritten.

Comment threadbundle/libraries/local_path_test.go
@andrewnester
andrewnester added this pull request to the merge queueApr 22, 2025
@andrewnester
andrewnester removed this pull request from the merge queue due to a manual request Apr 22, 2025
dyn.AnyIndex(),
dyn.Key("spec"),
dyn.Key("dependencies"),
dyn.AnyIndex(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Btw, all patterns in this path visitor package can be rewritten.

@andrewnester
andrewnester added this pull request to the merge queueApr 22, 2025
Merged via the queue into main with commit 526a70aApr 22, 2025
@andrewnester
andrewnester deleted the fix/env-spec-local-requirements branch April 22, 2025 14:41
deco-sdk-taggingBot added a commit that referenced this pull request Apr 23, 2025
## Release v0.249.0
### CLI
* Added `exclude-from` and `include-from` flags support to sync command ([#2660](#2660))
### Bundles
* Correctly translate paths to local requirements.txt file in environment dependencies ([#2736](#2736))
* Check for running resources with --fail-on-active-runs before any mutative operation during deploy ([#2743](#2743))
denik pushed a commit that referenced this pull request May 20, 2026
…nt dependencies (#2736)
## Changes
Correctly translate paths to local requirement.txt file in environment
dependencies
## Why
At the moment we don't translate paths to requirements.txt files which
makes it impossible to reference local path to such files in environment
dependencies. This PR fixes this
```
dependencies:
- -r ../requirements.txt
```
## Tests
Added acceptance test
<!-- If your PR needs to be included in the release notes for next
release,
add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.249.0
### CLI
* Added `exclude-from` and `include-from` flags support to sync command ([#2660](#2660))
### Bundles
* Correctly translate paths to local requirements.txt file in environment dependencies ([#2736](#2736))
* Check for running resources with --fail-on-active-runs before any mutative operation during deploy ([#2743](#2743))
Sign up for freeto 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.

4 participants

@andrewnester@pietern@denik