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

PSCE-408 feat: adds flags to set git provider information when interacting with the API #217

Merged
merged 14 commits into from
May 9, 2024

Conversation

jpower432
Copy link
Contributor

@jpower432 jpower432 commented May 2, 2024

Description

This feature simplifies running trestle-bot in different contexts.

  • Adds an environment variable option for passing in token info
  • Fixes a bug around checking for with_token input
  • Allows Git provider type and url information to be provided and falls back to the existing method of detection.

Fixes #200

Stacked with #215

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@jpower432 jpower432 changed the title feat: adds flags to set git provider information when interacting with the API PSCE-408 feat: adds flags to set git provider information when interacting with the API May 2, 2024
@jpower432 jpower432 added this to the 0.10.0 milestone May 2, 2024
@jpower432 jpower432 added the enhancement New feature or request label May 2, 2024
@jpower432 jpower432 force-pushed the add/add-git-provider-flags branch from d4503e9 to 79aad6e Compare May 3, 2024 23:51
@jpower432 jpower432 marked this pull request as ready for review May 6, 2024 21:59
@jpower432 jpower432 requested a review from a team May 6, 2024 21:59
@jpower432
Copy link
Contributor Author

Putting back into draft to rebase and resolve conflicts.

@jpower432 jpower432 marked this pull request as draft May 7, 2024 13:50
jpower432 added 10 commits May 7, 2024 09:52
The GitProviderFactory class manages the creation
of the GitProvider based on input and default logic.

Signed-off-by: Jennifer Power <[email protected]>
As the arguments list grows, grouping will make
understanding how to use and when to set much
clearer

Signed-off-by: Jennifer Power <[email protected]>
Using flag option to add to logic Git provider group for
useful help messages

Signed-off-by: Jennifer Power <[email protected]>
The logic was checking if with_token is None or empty which is
never true. This change updates the with-token flag to set to
true to evaluate if standard input should be read.

Signed-off-by: Jennifer Power <[email protected]>
To simplify running locally in headless mode, an environment
variable would be suitable over piping to standard input. This
also simplifies the action entrypoint scripts.

Signed-off-by: Jennifer Power <[email protected]>
This returns the with-token flag to its original implementation
to avoid breaking changes, but uses the const instead of default parameter.
This will make sure sys.stdin is only set if the flag is present.

Signed-off-by: Jennifer Power <[email protected]>
@jpower432 jpower432 force-pushed the add/add-git-provider-flags branch from d2ac478 to 232d2c5 Compare May 7, 2024 13:54
@jpower432 jpower432 marked this pull request as ready for review May 7, 2024 13:57
@jpower432 jpower432 requested a review from gvauter May 7, 2024 15:39
actions/autosync/README.md Outdated Show resolved Hide resolved
actions/create-cd/README.md Outdated Show resolved Hide resolved
actions/rules-transform/README.md Outdated Show resolved Hide resolved
actions/sync-upstreams/README.md Outdated Show resolved Hide resolved
trestlebot/provider_factory.py Show resolved Hide resolved
trestlebot/entrypoints/entrypoint_base.py Outdated Show resolved Hide resolved
trestlebot/entrypoints/entrypoint_base.py Show resolved Hide resolved
trestlebot/provider_factory.py Outdated Show resolved Hide resolved
jpower432 added 3 commits May 7, 2024 19:08
Newlines in descriptions caused issues in table formatting

Signed-off-by: Jennifer Power <[email protected]>
All reusable input/output logic should be defined in
entrypoint_base.py for easier management and readability

Signed-off-by: Jennifer Power <[email protected]>
@jpower432 jpower432 requested a review from gvauter May 8, 2024 15:25
Copy link
Member

@gvauter gvauter left a comment

Choose a reason for hiding this comment

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

New logic looks good, just two small logging fixes.

trestlebot/entrypoints/entrypoint_base.py Outdated Show resolved Hide resolved
trestlebot/entrypoints/entrypoint_base.py Outdated Show resolved Hide resolved
@jpower432 jpower432 requested a review from gvauter May 8, 2024 18:23
@jpower432 jpower432 merged commit 357937c into main May 9, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add configuration to provide Git provider information in addition to detecting it from the environment.
2 participants