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 support for curly brackets when resolving envs #2851

Open
kkawula opened this issue Jan 14, 2025 · 8 comments · May be fixed by #2868
Open

Add support for curly brackets when resolving envs #2851

kkawula opened this issue Jan 14, 2025 · 8 comments · May be fixed by #2868
Assignees
Labels
feature New feature request/description odboost: Easy ODBoost sncast

Comments

@kkawula
Copy link
Collaborator

kkawula commented Jan 14, 2025

Which components does the task require to be changed? (think hard pls)

snforge

Description

Context:
https://foundry-rs.github.io/starknet-foundry/appendix/scarb-toml.html?highlight=tool#scarbtoml-contents
We can define profiles in scarb.toml and use environmental variables as values.

Currently forge support such syntax: url = "$RPC_URL", but url = "${RPC_URL}" should be possible

Requested here: https://t.me/starknet_foundry_support/5363

TODO:

  • Implement described functionality -
    serde_json::Value::String(val) if val.starts_with('$') => resolve_env_variable(&val),
    val => Ok(val),
    }
    }
    fn resolve_env_variable(var: &str) -> Result<serde_json::Value> {
    assert!(var.starts_with('$'));
    let value = env::var(&var[1..])?;
    if let Ok(value) = value.parse::<Number>() {
    return Ok(serde_json::Value::Number(value));
    }
    if let Ok(value) = value.parse::<bool>() {
    return Ok(serde_json::Value::Bool(value));
    }
    Ok(serde_json::Value::String(value))
    }
  • Update documentation
  • Create relevant tests
@emarc99
Copy link

emarc99 commented Jan 16, 2025

I can handle this if assigned. I will study the codebase, check relevant crates, implement the feature and ensure test pass. Like I did here.

@cptartur cptartur added sncast feature New feature request/description and removed new labels Jan 17, 2025
@cptartur cptartur moved this from New to Triage in Starknet foundry Jan 17, 2025
@cptartur cptartur moved this from Triage to Backlog in Starknet foundry Jan 17, 2025
@cptartur
Copy link
Member

Hey, this issue will be available for taking during the ODBoost https://app.onlydust.com/hackathons/odboost-1.
If you are still interested in tacking on this one, please apply after the ODBoost start tomorrow after 3 PM CET.

@EjembiEmmanuel
Copy link

I'd like to handle this task.

@mexes20
Copy link

mexes20 commented Jan 22, 2025

Hello, I'd like to work on this.

I’m a developer with over three years of experience.

ETA: 24 hours

@codebestia
Copy link

Can I work on this? @cptartur
I am a good blockchain developer with ample experience in rust.
I am new here and i will love to contribute to this project.

How i will handle this

  • I will fork this repo and create a new branch for the issue
  • I will update the resolve_env_vairable function to also check if has curly braces
  • I will create and algorithm to extra the inner string within the curly braces (if there is curly braces)
  • I will write test to ensure it passes
  • I will update the documentation
  • I will finish task within 24 hours of assignment

@Thibrac
Copy link

Thibrac commented Jan 22, 2025

May I take care of this?

@Nityam573
Copy link

Hey @kkawula, can I get assigned to it I am new to open source contributor.
But got the right skills to do

@khayss
Copy link
Contributor

khayss commented Jan 22, 2025

Is this issue still available?

@codebestia codebestia linked a pull request Jan 23, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request/description odboost: Easy ODBoost sncast
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

9 participants