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

ensure a linebreak after config validation errors and do not parse config for help #4405

Merged
merged 2 commits into from
Aug 22, 2022
Merged

ensure a linebreak after config validation errors and do not parse config for help #4405

merged 2 commits into from
Aug 22, 2022

Conversation

wkloucek
Copy link
Contributor

@wkloucek wkloucek commented Aug 17, 2022

Description

This PR:

  • ensures that a line break is printed after the config validation error output
  • ensures that configuration is not parsed for help topics (but only on execution of the command)

Related Issue

Motivation and Context

make oCIS intuitive to use

How Has This Been Tested?

have a non configured oCIS (rm -rf ~/.ocis)

  • run ocis storage-users uploads list --help, it succeeds with this PR but not with master
  • run ocis server, it has a proper linebreak at the end of the error message
  • run ocis migrate shares --help, it succeds with this PR but not with master
  • run ocis migrate publicshares --help, it succeds with this PR but not with master

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Aug 17, 2022

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@wkloucek wkloucek requested review from aduffeck, kobergj and C0rby and removed request for lookacat and kulmann August 17, 2022 12:05
@mmattel
Copy link
Contributor

mmattel commented Aug 17, 2022

Great, thanks 👍

CHANGELOG.md Outdated Show resolved Hide resolved
ocis/pkg/command/migrate.go Outdated Show resolved Hide resolved
ocis/pkg/command/migrate.go Outdated Show resolved Hide resolved
ocis/pkg/command/migrate.go Outdated Show resolved Hide resolved
ocis/pkg/command/migrate.go Outdated Show resolved Hide resolved
@wkloucek
Copy link
Contributor Author

@kobergj thanks for your review, I got the remaining fmt.Printf("%v", err) cases covered and wrapped the fmt.Printf into a function so that they are not all over the place.

@wkloucek wkloucek requested a review from kobergj August 18, 2022 13:33
)

// LogError logs the error
func LogError(err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great. But they stutter as they are callled like configlog.LogError maybe just call them Error ReturnErrror ReturnFatal? So then they would be used like configlog.Error

Obviously not critical as some things just stutter....

@sonarcloud
Copy link

sonarcloud bot commented Aug 22, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
54.7% 54.7% Duplication

@wkloucek wkloucek self-assigned this Aug 22, 2022
@mmattel
Copy link
Contributor

mmattel commented Aug 22, 2022

Maybe to re-kick CI to see if it turns green post the not starting issue last week...?

@wkloucek
Copy link
Contributor Author

Maybe to re-kick CI to see if it turns green post the not starting issue last week...?

CI is green except the ARM pipelines because there are no ARM runners

@wkloucek wkloucek merged commit 15c1a99 into owncloud:master Aug 22, 2022
@wkloucek wkloucek deleted the config-validation-line-break-and-help branch August 22, 2022 09:12
ownclouders pushed a commit that referenced this pull request Aug 22, 2022
Merge: c63b411 9f2be9f
Author: Willy Kloucek <34452982+wkloucek@users.noreply.github.com>
Date:   Mon Aug 22 11:12:22 2022 +0200

    Merge pull request #4405 from wkloucek/config-validation-line-break-and-help

    ensure a linebreak after config validation errors and do not parse config for help
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.

missing line break for error message
4 participants