Skip to content

perf: #5 refactor config props#15

Merged
TheRealAgentK merged 7 commits intomainfrom
config-props-optional
Jan 27, 2025
Merged

perf: #5 refactor config props#15
TheRealAgentK merged 7 commits intomainfrom
config-props-optional

Conversation

@miquelbeltran
Copy link
Contributor

@miquelbeltran miquelbeltran commented Jan 26, 2025

perf: #5 refactor config props

Description 📝

The main idea of a "config prop" is to facilitate parsing either from arguments or env variables (and in the future from a config dot file as well).

  • Approach: The ConfigProps class is now converted into the ConfigProp class, and static consts for each of the config properties (app id, token and api-key) are now individual ConfigProp const instances.

You can obtain the value (either from args or env-vars) calling like:

ConfigProp.token.from(arguments);

Type of change

  • Refactor

Updates

  • Refactored ConfigProps and Environment to support this change.
  • Refactored all commands that used ConfigProps originally

Test plan 🧪

Tested some commands to verify everything works as before:

➜  raygun-cli git:(config-props-optional) RAYGUN_API_KEY=123 RAYGUN_TOKEN=123 dart run bin/raygun_cli.dart deployments --version=1.2.3 --verbose
token: 123
api-key: 123
version: 1.2.3
owner-name: null
email-address: null
comment: null
scm-identifier: null
scm-type: null
....

Also updated unit tests.

Author to check 👓

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Reviewer to check ✔️

  • Project and all contained modules builds successfully
  • Change has been dev-/reviewer-tested, where possible
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

@miquelbeltran miquelbeltran mentioned this pull request Jan 26, 2025
11 tasks
Copy link
Contributor

@TheRealAgentK TheRealAgentK left a comment

Choose a reason for hiding this comment

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

LGTM

@TheRealAgentK
Copy link
Contributor

Merging before #8, so that I can make the required adjustments.

@TheRealAgentK TheRealAgentK merged commit b1e0acd into main Jan 27, 2025
5 checks passed
@sumitramanga sumitramanga deleted the config-props-optional branch May 2, 2025 01:12
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.

2 participants