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

Disambiguate files on import #3085

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Disambiguate files on import #3085

wants to merge 1 commit into from

Conversation

jonenst
Copy link
Contributor

@jonenst jonenst commented Jun 26, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

#989
#3082
#2959
others...

What kind of change does this PR introduce?
bug fix

What is the current behavior?

$ itools convert-network --input-file foo.xiidm # will wrongly use foo.xml from cgmes if it exists

What is the new behavior (if this is a feature change)?
always use the file specified by the user in the command line

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Copy link

sonarcloud bot commented Jun 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
59.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@jonenst
Copy link
Contributor Author

jonenst commented Jun 28, 2024

Need more tests

@@ -79,6 +79,12 @@ public String getComment() {

@Override
public boolean exists(ReadOnlyDataSource dataSource) {
// if given a main file with an extension and it's not compatible, don't import
// to avoid importing a file when the user specified another
if (!dataSource.getBaseExtension().isEmpty()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug here if getBaseExtension.equals(EXT) we must not return false...

@@ -515,6 +515,12 @@ private static boolean reactiveLimitsAreOk(double minQ, double maxQ) {

@Override
public boolean exists(ReadOnlyDataSource dataSource) {
// if given a main file with an extension and it's not compatible, don't import
// to avoid importing a file when the user specified another
if (!dataSource.getBaseExtension().isEmpty()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug

Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
Sign up for free to 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.

None yet

1 participant