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

[BUG] Executing mcdev cdp results in market configuration errors #1806

Closed
1 of 2 tasks
dnivara-0 opened this issue Oct 25, 2024 · 2 comments · Fixed by #1821 or #1847
Closed
1 of 2 tasks

[BUG] Executing mcdev cdp results in market configuration errors #1806

dnivara-0 opened this issue Oct 25, 2024 · 2 comments · Fixed by #1821 or #1847
Assignees
Labels
bug Something isn't working e/DevOps EPIC
Milestone

Comments

@dnivara-0
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Current Behavior:
Running mcdev cdp results in the following error message:

Could not find the market 'M' in your configuration file.

I've been investigating this repository for about 3 hours and may not fully understand the code structure. I encountered this issue while setting up mcdev today, so please correct me if my interpretation is incorrect.

Observed Issue:
The issue appears to stem from the handling of market configuration data in the function buildDeltaDefinitions within devops.js.

In the code:

  • Line 423: const sourceMarket = Object.values(properties.marketList[sourceMlName])[0];

    It appears that sourceMarket is assigned a string value.

  • Line 468: await Builder.buildTemplate(bu, type, keyArr, sourceMarket);

    Here, the string sourceMarket is passed to the buildTemplate function.

Within lib/Builder.js, in the buildTemplate function, there’s a loop:

for (const market of marketArr) {
    if (Util.checkMarket(market, properties)) {
        Object.assign(templateVariables, properties.markets[market]);
    } else {
        // do not execute the rest of this method if a market was invalid
        return;
    }
}

The code expects marketArr to be an array. However, since sourceMarket is a string, this discrepancy causes Util.checkMarket to return false for any market name(in my case it starts with 'M') leading to a failure in template generation.

Impact:

  • Template files are not generated as expected, preventing subsequent bdp commands from executing successfully.

Potential Cause:
This behavior may have been introduced in this PR, where handling for marketArr does not account for string inputs in cases like mine.

Expected Behavior

No response

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Run '...'
  4. See error...

Version

7.4.4

Environment

  • OS: MacOS
  • Node: 20.11.1
  • npm: 10.8.3

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@dnivara-0 dnivara-0 added bug Something isn't working NEW not yet analyzed new issues get this label labels Oct 25, 2024
@JoernBerkefeld JoernBerkefeld self-assigned this Oct 25, 2024
@JoernBerkefeld
Copy link
Contributor

nicely detailed bug report! thank you. looking into the details and will try to reproduce this on my end

@JoernBerkefeld JoernBerkefeld added this to the 7.4.5 milestone Nov 2, 2024
@JoernBerkefeld JoernBerkefeld added e/DevOps EPIC and removed NEW not yet analyzed new issues get this label labels Nov 2, 2024
@JoernBerkefeld JoernBerkefeld linked a pull request Nov 2, 2024 that will close this issue
4 tasks
@github-actions github-actions bot closed this as completed Nov 2, 2024
Copy link

github-actions bot commented Nov 2, 2024

Closed by #1821.

@JoernBerkefeld JoernBerkefeld mentioned this issue Nov 8, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working e/DevOps EPIC
Projects
None yet
2 participants