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

DXCDT-396: Standardize error messages #943

Merged
merged 5 commits into from
Dec 19, 2023
Merged

DXCDT-396: Standardize error messages #943

merged 5 commits into from
Dec 19, 2023

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Dec 14, 2023

🔧 Changes

This pull request aims to enhance the consistency and clarity of error messages throughout the Auth0 CLI. By standardizing error messages, we improve the user experience, making it easier for developers to troubleshoot and understand issues during CLI interactions.

📚 References

🔬 Testing

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@@ -16,7 +16,7 @@ linters:
- whitespace
- goimports
- gosimple
# - errcheck
- errcheck
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took the opportunity to update the golangci lint config as well to help with err checks, error messages and as well fix comments.

@sergiught sergiught marked this pull request as ready for review December 14, 2023 18:52
@sergiught sergiught requested a review from a team as a code owner December 14, 2023 18:52
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

Attention: 178 lines in your changes are missing coverage. Please review.

Comparison is base (820d24c) 72.11% compared to head (eaef9dc) 72.35%.

Files Patch % Lines
internal/cli/rules.go 35.48% 17 Missing and 3 partials ⚠️
internal/cli/apis.go 23.52% 11 Missing and 2 partials ⚠️
internal/cli/custom_domains.go 43.47% 13 Missing ⚠️
internal/cli/organizations.go 45.00% 11 Missing ⚠️
internal/cli/apps.go 52.38% 10 Missing ⚠️
internal/cli/roles_permissions.go 28.57% 10 Missing ⚠️
internal/cli/roles.go 18.18% 9 Missing ⚠️
internal/cli/users.go 20.00% 8 Missing ⚠️
internal/cli/universal_login_templates.go 12.50% 7 Missing ⚠️
internal/prompt/editor.go 0.00% 7 Missing ⚠️
... and 27 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #943      +/-   ##
==========================================
+ Coverage   72.11%   72.35%   +0.23%     
==========================================
  Files          92       92              
  Lines       12629    12654      +25     
==========================================
+ Hits         9108     9156      +48     
+ Misses       2978     2955      -23     
  Partials      543      543              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

internal/auth0/quickstart.go Outdated Show resolved Hide resolved
internal/auth0/quickstart.go Outdated Show resolved Hide resolved
internal/auth0/quickstarts_test.go Outdated Show resolved Hide resolved
internal/auth0/quickstarts_test.go Outdated Show resolved Hide resolved
internal/cli/apis.go Show resolved Hide resolved
internal/cli/roles_permissions.go Show resolved Hide resolved
internal/cli/root.go Outdated Show resolved Hide resolved
internal/cli/root.go Outdated Show resolved Hide resolved
internal/cli/root.go Outdated Show resolved Hide resolved
internal/cli/terraform_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@willvedd willvedd left a comment

Choose a reason for hiding this comment

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

Possibly some nit-picky things to fuss over but overall looks like a solid n+1 (or n+86).

@sergiught sergiught merged commit b909520 into main Dec 19, 2023
8 checks passed
@sergiught sergiught deleted the DXCDT-396-errors branch December 19, 2023 11:07
m3talsmith pushed a commit that referenced this pull request Dec 19, 2023
m3talsmith pushed a commit that referenced this pull request Dec 21, 2023
* Bump github.com/auth0/go-auth0 from 1.2.0 to 1.3.0 (#908)

Bumps [github.com/auth0/go-auth0](https://github.com/auth0/go-auth0) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/auth0/go-auth0/releases)
- [Changelog](https://github.com/auth0/go-auth0/blob/main/CHANGELOG.md)
- [Commits](auth0/go-auth0@v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/auth0/go-auth0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* dxcdt-615-goreleaser-upgrade (#909)

* Fix: Remove or replace deprecations for GoReleaser config

Remove deprecated replacements
Replace deprecated brews tap
Replace deprecated scoop entries
Fix name_template to reflect exact current naming conventions

* DXCDT-582: Convert audience into a drop down in interactive mode in test token cmd (#906)

Convert audience into a drop down in interactive mode in test token cmd

* Bump github.com/auth0/go-auth0 from 1.2.0 to 1.3.0 (#908)

Bumps [github.com/auth0/go-auth0](https://github.com/auth0/go-auth0) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/auth0/go-auth0/releases)
- [Changelog](https://github.com/auth0/go-auth0/blob/main/CHANGELOG.md)
- [Commits](auth0/go-auth0@v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/auth0/go-auth0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* DXCDT-582: Convert audience into a drop down in interactive mode in test token cmd (#906)

Convert audience into a drop down in interactive mode in test token cmd

Title Os for final release name fit

* Bump goreleaser version

* Use progress bars for long multistep processes

Create generic ProgressBar
Ensure 1 or less items behaves like Spinner
Add progress bars to possibly longer processes

* Bump github.com/google/uuid from 1.4.0 to 1.5.0 (#942)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Dxcdt 578 increase results amount in lists (#940)

* Bump github.com/auth0/go-auth0 from 1.2.0 to 1.3.0 (#908)

Bumps [github.com/auth0/go-auth0](https://github.com/auth0/go-auth0) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/auth0/go-auth0/releases)
- [Changelog](https://github.com/auth0/go-auth0/blob/main/CHANGELOG.md)
- [Commits](auth0/go-auth0@v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/auth0/go-auth0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* dxcdt-615-goreleaser-upgrade (#909)

* Fix: Remove or replace deprecations for GoReleaser config

Remove deprecated replacements
Replace deprecated brews tap
Replace deprecated scoop entries
Fix name_template to reflect exact current naming conventions

* DXCDT-582: Convert audience into a drop down in interactive mode in test token cmd (#906)

Convert audience into a drop down in interactive mode in test token cmd

* Bump github.com/auth0/go-auth0 from 1.2.0 to 1.3.0 (#908)

Bumps [github.com/auth0/go-auth0](https://github.com/auth0/go-auth0) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/auth0/go-auth0/releases)
- [Changelog](https://github.com/auth0/go-auth0/blob/main/CHANGELOG.md)
- [Commits](auth0/go-auth0@v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/auth0/go-auth0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* DXCDT-582: Convert audience into a drop down in interactive mode in test token cmd (#906)

Convert audience into a drop down in interactive mode in test token cmd

Title Os for final release name fit

* Bump goreleaser version

* Increase default page amount to 100 results per page

* Updated docs for defalut list limit

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com>

* Bump github.com/auth0/go-auth0 from 1.3.1 to 1.4.0 (#944)

* DXCDT-396: Standardize error messages (#943)

* Bump golang.org/x/crypto from 0.16.0 to 0.17.0 (#947)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Ignore err for adding steps to the ProgressBar

This is a specific error, internal to the developer and not of use to the user

* Organize imports

* Improve error messages in APIs

* Add documentation comment for ProgressBar

Co-authored-by: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com>

* Normalize delete error messages

* Discard duplicate path escape

* Revert data file

* Return nil on 0 case

* Ensure ID isn't empty when deleting an organization

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergiu Ghitea <28300158+sergiught@users.noreply.github.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.

4 participants