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

[SM-1096] Unify State Variable Naming #895

Merged
merged 10 commits into from
Jul 25, 2024
Merged

[SM-1096] Unify State Variable Naming #895

merged 10 commits into from
Jul 25, 2024

Conversation

coltonhurst
Copy link
Member

@coltonhurst coltonhurst commented Jul 10, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/SM-1096

📔 Objective

The naming around state files and paths is inconsistent. This PR aims to make the usage consistent.

Every mention of state for access token auth should follow this naming logic:

state_dir <- This refers to the state directory, where state files are stored. The sdk is currently only aware of state files, directory handling is still being done in bws.
state_file <- This refers to a specific state file.

In our code we don't append naming to variables to indicate the type (Hungarian Notation), so I thought it pertinent to truncate _path from these, preferring more descriptive state_dir and state_file for the names.

Thanks @dani-garcia for pointing this out here.

⚠️ Note ⚠️ This also simplifies the state_file_dir key in the bws config file to state_dir. There will be more changes to this functionality with SM-1174, so I will wait to update the changelog for the next bws version until all this is completed.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@coltonhurst coltonhurst self-assigned this Jul 10, 2024
Copy link
Contributor

github-actions bot commented Jul 10, 2024

Logo
Checkmarx One – Scan Summary & Detailsbba9884d-43b1-432f-8a93-83bd057e825e

No New Or Fixed Issues Found

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 58.08%. Comparing base (5e5ddab) to head (341581c).
Report is 3 commits behind head on main.

Files Patch % Lines
crates/bws/src/state.rs 0.00% 6 Missing ⚠️
crates/bws/src/main.rs 0.00% 3 Missing ⚠️
crates/bws/src/config.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #895   +/-   ##
=======================================
  Coverage   58.07%   58.08%           
=======================================
  Files         194      194           
  Lines       13194    13193    -1     
=======================================
  Hits         7663     7663           
+ Misses       5531     5530    -1     

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

@coltonhurst coltonhurst changed the title SM-1096: Unify State Variable Naming [SM-1096] Unify State Variable Naming Jul 11, 2024
@coltonhurst coltonhurst marked this pull request as ready for review July 12, 2024 20:37
@coltonhurst coltonhurst requested a review from a team as a code owner July 12, 2024 20:37
@coltonhurst coltonhurst requested a review from dani-garcia July 12, 2024 20:40
dani-garcia
dani-garcia previously approved these changes Jul 15, 2024
Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

LGTM, do we need to update the changelog as well?

Copy link
Contributor

@mzieniukbw mzieniukbw left a comment

Choose a reason for hiding this comment

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

Found a typo in Go language wrapper README.md.

crates/bws/src/config.rs Show resolved Hide resolved
languages/go/README.md Outdated Show resolved Hide resolved
@coltonhurst coltonhurst merged commit dfdbf7d into main Jul 25, 2024
104 checks passed
@coltonhurst coltonhurst deleted the sm/sm-1096 branch July 25, 2024 15:07
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.

3 participants