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

Cyclic import detected mistakenly #390

Open
HolQue opened this issue Nov 15, 2024 · 5 comments
Open

Cyclic import detected mistakenly #390

HolQue opened this issue Nov 15, 2024 · 5 comments

Comments

@HolQue
Copy link
Collaborator

HolQue commented Nov 15, 2024

A file containing common values, is imported

  • several times,
  • in different subkeys,
  • within the same file,
  • within imported files.

This is detected as 'cyclic import' mistakenly.

But should be possible.

Example:

{
   "root"        : "../",
   "values_AA_1" : {"AA_1_a"   : 1,
                    "[import]" : "${root}global_defs/imported.common.sublevel.jsonp",
                    "AA_1_b"   : 2
                   },
   "values_AA_2" : {"AA_2_a"   : 1,
                    "[import]" : "${root}global_defs/imported.common.sublevel.jsonp",
                    "AA_2_b"   : 2
                   }
}

Result:

Cyclic imported json file '... /dynamic_imports/global_defs/imported.common.sublevel.jsonp'!
In file: '... /dynamic_imports/AA/BB/imported.BB.CSL.jsonp'

Test cases: JPP_1112, JPP_1113 (commented out)

Reference: #389 (comment)

@test-fullautomation
Copy link
Owner

Hi @namsonx ,
please look into this.
This would be required for 0.13.1
Files can be multiple times imported, also in different files. Only recursion must be blocked.
Thank you,
Thomas

@namsonx namsonx moved this from Open to In Progress in RobotFramework AIO Nov 22, 2024
@namsonx
Copy link
Collaborator

namsonx commented Nov 25, 2024

Hello Holger,

This ticket was implemented and pushed to stabi branch, could you help us verify it.

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented Nov 25, 2024

Hi Son,

the error message changed a bit, but the JSON content above still detects a cyclic import.

@namsonx
Copy link
Collaborator

namsonx commented Nov 26, 2024

Hello Holger,

It was my mistake, I pushed the tiny change to stabi branch to correct it.

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented Nov 26, 2024

Retest successful. Issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants