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

feat: --output-path flag for pizza generate codeowners #223

Conversation

udaypatel1
Copy link
Contributor

@udaypatel1 udaypatel1 commented Oct 14, 2024

Description

This PR adds logic to handle an optional output directory flag value to the generate codeowners command

Mirrors the expected behavior of the same flag that exists for generate config

Related Tickets & Documents

Resolves #222

I am not sure how to self-assign the ticket – if an admin could assign the Issue to me, that'd be wonderful :)

Mobile & Desktop Screenshots/Recordings

output

Steps to QA

  1. Build the CLI
  2. Run pizza generate codeowners with and without the -o / --output-path flag
  • Testing Permutations
    1. pizza generate codeowners .
      • should modify or create a CODEOWNERS file
    2. pizza generate codeowners . -o /path/to/some/directory/
      • should modify or create a CODEOWNERS file in the directory path provided
    3. pizza generate codeowners . -o /path/to/some/directory/ --owners-style-file
      • should modify or create an OWNERS file in the directory path provided

All other functionalities should remain unchanged and BAU. The optional flag should just create or modify in a specified file path that is given.

Tier (staff will fill in)

  • Tier 1
  • Tier 2
  • Tier 3
  • Tier 4

[optional] What gif best describes this PR or how it makes you feel?

happy-feet

Please let me know if I'm missing anything or there are complications! Thank you! 😁

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks Passed!

@udaypatel1 udaypatel1 changed the title Feature: Add logic to handle output path flag for generating codeowners file feat: add logic to handle output path flag for generating codeowners file Oct 14, 2024
@udaypatel1 udaypatel1 changed the title feat: add logic to handle output path flag for generating codeowners file feat: --output-path flag for pizza generate codeowners Oct 14, 2024
cmd/generate/codeowners/codeowners.go Outdated Show resolved Hide resolved
cmd/generate/codeowners/codeowners.go Outdated Show resolved Hide resolved
@jpmcb
Copy link
Member

jpmcb commented Oct 14, 2024

Great work on this! Thanks for taking the initiative to pick this up!! 👏🏼👏🏼 👏🏼

@udaypatel1 udaypatel1 force-pushed the feat/generate-codeowners-output-dir-flag branch 2 times, most recently from 0b30d66 to a5a097f Compare October 15, 2024 14:18
@udaypatel1 udaypatel1 requested a review from jpmcb October 15, 2024 15:35
cmd/generate/codeowners/codeowners.go Outdated Show resolved Hide resolved
cmd/generate/codeowners/codeowners.go Outdated Show resolved Hide resolved
cmd/generate/codeowners/codeowners.go Outdated Show resolved Hide resolved
@udaypatel1 udaypatel1 force-pushed the feat/generate-codeowners-output-dir-flag branch 3 times, most recently from b8d8a54 to 154a2d7 Compare October 15, 2024 18:39
@udaypatel1 udaypatel1 requested a review from jpmcb October 16, 2024 02:52
@udaypatel1
Copy link
Contributor Author

Log from within the target repo + flag:

image

Log from outside of the target repo + flag:

image

Log from within the target repo + no flag:

image

Log from outside of the target repo + no flag:

image


Feel free to suggest any log changes that you may want, if any.

cmd/generate/codeowners/codeowners.go Outdated Show resolved Hide resolved
Copy link
Member

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

Thanks for this @udaypatel1! 🚢

@udaypatel1 udaypatel1 force-pushed the feat/generate-codeowners-output-dir-flag branch from 154a2d7 to 09ed80b Compare October 16, 2024 16:40
@nickytonline nickytonline merged commit 1c5ce09 into open-sauced:beta Oct 16, 2024
6 checks passed
open-sauced bot pushed a commit that referenced this pull request Oct 16, 2024
## [2.4.0-beta.1](v2.3.0...v2.4.0-beta.1) (2024-10-16)

### 🍕 Features

* `--output-path` flag for `pizza generate codeowners` ([#223](#223)) ([1c5ce09](1c5ce09))
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.

Feature: Specify Output Directory for CODEOWNERS file
3 participants