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

Datasources - part 5: fixes #3114

Merged
merged 10 commits into from
Aug 9, 2024
Merged

Datasources - part 5: fixes #3114

merged 10 commits into from
Aug 9, 2024

Conversation

rolnico
Copy link
Member

@rolnico rolnico commented Aug 2, 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?
No

What kind of change does this PR introduce?
Bug fix

What is the current behavior?

  • In CgmesOnDataSource.checkIfMainFileNotWithCgmesData(), a stream was open without first checking if the file existed, which could result in an unexpected exception.

What is the new behavior (if this is a feature change)?

  • In CgmesOnDataSource.checkIfMainFileNotWithCgmesData(), we first check if the file exists before trying to open a stream on it.

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

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

The following methods of CgmesOnDataSource now throw an IOException:

  • public boolean exists()
  • public boolean existsCim14()

If you call them, you should catch or propagate this exception. To keep the same behavior as before, you can catch this exception and propagate it in a new UncheckedIOException.

Other information:

Base automatically changed from nro/datasources_3_new_features to main August 2, 2024 15:11
rolnico added 3 commits August 2, 2024 17:14
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
@flo-dup flo-dup force-pushed the nro/datasources_5_fixes branch from 71996d7 to 00bc3c2 Compare August 2, 2024 15:14
flo-dup added 5 commits August 7, 2024 13:50
This reverts commit 00bc3c2.

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@flo-dup flo-dup requested a review from olperr1 August 8, 2024 09:46
flo-dup and others added 2 commits August 8, 2024 11:48
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Olivier Perrin <olivier.perrin@rte-france.com>
@olperr1 olperr1 added the Breaking Change API is broken label Aug 8, 2024
Copy link

sonarqubecloud bot commented Aug 8, 2024

@flo-dup flo-dup merged commit fd1cd10 into main Aug 9, 2024
7 checks passed
@flo-dup flo-dup deleted the nro/datasources_5_fixes branch August 9, 2024 14:53
geofjamg pushed a commit that referenced this pull request Sep 18, 2024
* check if file exist before opening stream in CgmesOnDataSource
* EXTENSIONS to EXTENSION
* Move the IOException catch to CgmesImport::exists(ReadOnlyDataSource)
* Use parameterized unit tests on changed file CgmesOnDataSourceTest
* Add IOException unit test

Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Co-authored-by: Florian Dupuy <florian.dupuy@rte-france.com>
Co-authored-by: Olivier Perrin <olivier.perrin@rte-france.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change API is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants