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

fix bug in package replace that breaks versioned imports #2279

Closed
h4ck3rk3y opened this issue Mar 13, 2024 · 0 comments · Fixed by #2299 or #2308
Closed

fix bug in package replace that breaks versioned imports #2279

h4ck3rk3y opened this issue Mar 13, 2024 · 0 comments · Fixed by #2299 or #2308
Assignees
Labels
bug Something isn't working

Comments

@h4ck3rk3y
Copy link
Contributor

What's your CLI version?

0.88.3

Description & steps to reproduce

I was on the chainlink node package in awesome kurtosis and i was trying to make it depend on 1.4.0 via Package replace but it failed with

https://app.circleci.com/pipelines/github/kurtosis-tech/awesome-kurtosis/1620/workflows/22629b4c-e7c5-419c-97e3-9726bca1f34b/jobs/4232?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary

Here is the change I made - kurtosis-tech/awesome-kurtosis@f9638dd

It fails with tags too!

Desired behavior

Replace with specific versions should work

What is the severity of this bug?

Papercut; this bug is frustrating, but I have a workaround.

What area of the product does this pertain to?

CLI: the Command Line Interface

@h4ck3rk3y h4ck3rk3y added the bug Something isn't working label Mar 13, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 15, 2024
## Description
Fix the package replace logic when using tag, branch or commit

The current issue is the `package replace logic` fails when you add a
tag, branch or commit in the replace value, like this example:

`replace:
- github.com/kurtosis-tech/ethereum-package:
github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`


If we see the evaluation error 

`Evaluation error: An error occurred while loading the module
'github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/src/package_io/input_parser.star'
Caused by: '/input_parser.star' doesn't exist in the package
'kurtosis-tech/ethereum-package'
at
[github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/main.star:1:29]:
<toplevel>
at
[github.com/kurtosis-tech/awesome-kurtosis/chainlink-node/main.star:2:33]:
<toplevel>`

we understand it's trying to import the file from this path
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`
and it doesn't exist because the folder, inside the APIC file system, is
created without the hash, it's
`github.com/kurtosis-tech/ethereum-package`

This is happening because an absolute locator like this
`github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star`
does not incorporate the concept of hash, branch or commit.

The fix is incorporated the concept of `hash, branch or commit` in a new
AbsoluteLocator object, so this way we can specify if the absolute
locator is pointing to other place than the main branch.
            
With this change we can accept the
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`
replace value and an absolute locator string like this
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/src/package_io/input_parser.star`
will be represented with an AbsoluteLocator object with locator
`github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star`
and and tagBranchOrCommit `da55be84861e93ce777076e545abee35ff2d51ce`

We already had support for retrieving packages from different tag,
branch or commit but only for `packageId` values and not for `absolute
locators`



## REMINDER: Tag Reviewers, so they get notified to review

## Is this change user facing?
YES

## References (if applicable)
Fix #2279
github-merge-queue bot pushed a commit that referenced this issue Mar 18, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.88.8](0.88.7...0.88.8)
(2024-03-15)


### Features

* Add active cancel at period end payment subscription status
([#2307](#2307))
([eea4e9b](eea4e9b))


### Bug Fixes

* the package replace logic when using tag, branch or commit
([#2299](#2299))
([72da1cb](72da1cb)),
closes [#2279](#2279)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com>
tedim52 pushed a commit that referenced this issue Mar 21, 2024
## Description
Fix the package replace logic when using tag, branch or commit

The current issue is the `package replace logic` fails when you add a
tag, branch or commit in the replace value, like this example:

`replace:
- github.com/kurtosis-tech/ethereum-package:
github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`


If we see the evaluation error 

`Evaluation error: An error occurred while loading the module
'github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/src/package_io/input_parser.star'
Caused by: '/input_parser.star' doesn't exist in the package
'kurtosis-tech/ethereum-package'
at
[github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/main.star:1:29]:
<toplevel>
at
[github.com/kurtosis-tech/awesome-kurtosis/chainlink-node/main.star:2:33]:
<toplevel>`

we understand it's trying to import the file from this path
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`
and it doesn't exist because the folder, inside the APIC file system, is
created without the hash, it's
`github.com/kurtosis-tech/ethereum-package`

This is happening because an absolute locator like this
`github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star`
does not incorporate the concept of hash, branch or commit.

The fix is incorporated the concept of `hash, branch or commit` in a new
AbsoluteLocator object, so this way we can specify if the absolute
locator is pointing to other place than the main branch.
            
With this change we can accept the
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`
replace value and an absolute locator string like this
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/src/package_io/input_parser.star`
will be represented with an AbsoluteLocator object with locator
`github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star`
and and tagBranchOrCommit `da55be84861e93ce777076e545abee35ff2d51ce`

We already had support for retrieving packages from different tag,
branch or commit but only for `packageId` values and not for `absolute
locators`



## REMINDER: Tag Reviewers, so they get notified to review

## Is this change user facing?
YES

## References (if applicable)
Fix #2279
tedim52 pushed a commit that referenced this issue Mar 21, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.88.8](0.88.7...0.88.8)
(2024-03-15)


### Features

* Add active cancel at period end payment subscription status
([#2307](#2307))
([eea4e9b](5fbe401))


### Bug Fixes

* the package replace logic when using tag, branch or commit
([#2299](#2299))
([72da1cb](273861c)),
closes [#2279](#2279)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com>
tedim52 pushed a commit that referenced this issue Mar 21, 2024
## Description
Fix the package replace logic when using tag, branch or commit

The current issue is the `package replace logic` fails when you add a
tag, branch or commit in the replace value, like this example:

`replace:
- github.com/kurtosis-tech/ethereum-package:
github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`


If we see the evaluation error 

`Evaluation error: An error occurred while loading the module
'github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/src/package_io/input_parser.star'
Caused by: '/input_parser.star' doesn't exist in the package
'kurtosis-tech/ethereum-package'
at
[github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/main.star:1:29]:
<toplevel>
at
[github.com/kurtosis-tech/awesome-kurtosis/chainlink-node/main.star:2:33]:
<toplevel>`

we understand it's trying to import the file from this path
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`
and it doesn't exist because the folder, inside the APIC file system, is
created without the hash, it's
`github.com/kurtosis-tech/ethereum-package`

This is happening because an absolute locator like this
`github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star`
does not incorporate the concept of hash, branch or commit.

The fix is incorporated the concept of `hash, branch or commit` in a new
AbsoluteLocator object, so this way we can specify if the absolute
locator is pointing to other place than the main branch.
            
With this change we can accept the
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce`
replace value and an absolute locator string like this
`github.com/kurtosis-tech/ethereum-package@da55be84861e93ce777076e545abee35ff2d51ce/src/package_io/input_parser.star`
will be represented with an AbsoluteLocator object with locator
`github.com/kurtosis-tech/ethereum-package/src/package_io/input_parser.star`
and and tagBranchOrCommit `da55be84861e93ce777076e545abee35ff2d51ce`

We already had support for retrieving packages from different tag,
branch or commit but only for `packageId` values and not for `absolute
locators`



## REMINDER: Tag Reviewers, so they get notified to review

## Is this change user facing?
YES

## References (if applicable)
Fix #2279
tedim52 pushed a commit that referenced this issue Mar 21, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.88.8](0.88.7...0.88.8)
(2024-03-15)


### Features

* Add active cancel at period end payment subscription status
([#2307](#2307))
([eea4e9b](f54c2e8))


### Bug Fixes

* the package replace logic when using tag, branch or commit
([#2299](#2299))
([72da1cb](1abcdcc)),
closes [#2279](#2279)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants