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

Make component field configurable #150

Merged

Conversation

lgecse
Copy link
Contributor

@lgecse lgecse commented Aug 3, 2023

Fixes #149

Dev notes:

  • added jira-components field to the config
  • added logic to fill the field of the Jira item when creating and updating
  • updated readme

@lgecse lgecse requested a review from a team as a code owner August 3, 2023 11:37
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #150 (f0f5cce) into main (0af3507) will not change coverage.
The diff coverage is n/a.

❗ Current head f0f5cce differs from pull request most recent head d60c7de. Consider uploading reports for the commit d60c7de to get more accurate results

@@          Coverage Diff          @@
##            main    #150   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          1       1           
  Lines         67      67           
=====================================
  Misses        67      67           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lgecse lgecse force-pushed the feature/add_component_when_creating_issue branch 2 times, most recently from d6f50ee to 605d8a2 Compare August 3, 2023 14:00
Copy link
Contributor

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

Great start, @lgecse!

The component field on Jira appears to support multiple components, so we'll want to support a slice of components vs a single component string in our config.

Additionally, have you considered what will happen in update scenarios (especially ones where the list of components that the user specifies in the config for this tool does not match the list of components already set on Jira)?

Given this tools' goal of being a one-way sync, we should:

  • get the current list of components for the issue
  • add the components specified in this config, but:
  • never remove components that are already set on the issue

(and have tests to ensure that behavior is adhered to)

README.md Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
@lgecse
Copy link
Contributor Author

lgecse commented Aug 3, 2023

@justaugustus I was thinking about the update path, I'm working on it rn.

The aim of this PR is to make the issue creation work when the component field in Jira is set mandatory. As I think more and more I have to realise there could be other Jira fields set required in a Jira setup. It would be nice to get this behaviour generic eventually.

I agree with never removing components from Jira issues, only adding new ones to the list.

@lgecse lgecse marked this pull request as draft August 3, 2023 16:10
@lgecse lgecse changed the title Feature/add component when creating issue Make component field configurable Aug 3, 2023
@lgecse lgecse force-pushed the feature/add_component_when_creating_issue branch from 017897f to f514c5c Compare August 7, 2023 11:59
@lgecse lgecse marked this pull request as ready for review August 7, 2023 12:05
cmd/root.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
internal/jira/issue/issue.go Outdated Show resolved Hide resolved
internal/jira/issue/issue.go Outdated Show resolved Hide resolved
internal/options/options.go Outdated Show resolved Hide resolved
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
@lgecse lgecse force-pushed the feature/add_component_when_creating_issue branch from d72fc03 to 46ef7d1 Compare August 7, 2023 17:00
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
internal/config/config.go Outdated Show resolved Hide resolved
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
@rappizs
Copy link
Contributor

rappizs commented Aug 14, 2023

(and have tests to ensure that behavior is adhered to)

Will this be part of this PR or it will be covered by #11?

@justaugustus
Copy link
Contributor

@lgecse -- it looks like the commits have slowed here... are you ready for another review pass?

@lgecse
Copy link
Contributor Author

lgecse commented Aug 15, 2023

@justaugustus I'd be happy to get a second review, thanks a lot in advance!

Copy link
Contributor

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

@lgecse -- Flagging a previous review comment, which I think will change some of the logic throughout.

RepoName string `json:"repo-name,omitempty" mapstructure:"repo-name"`
JiraURI string `json:"jira-uri,omitempty" mapstructure:"jira-uri"`
JiraProject string `json:"jira-project,omitempty" mapstructure:"jira-project"`
JiraComponents string `json:"jira-components,omitempty" mapstructure:"jira-components"`
Copy link
Contributor

Choose a reason for hiding this comment

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

(discussed in #150 (review))

This should be []string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved, please review.

lgecse and others added 3 commits September 4, 2023 15:18
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Signed-off-by: Laszlo Gecse <lgecse@cisco.com>
Copy link
Contributor

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

Thanks @lgecse!!

@justaugustus justaugustus merged commit fcec535 into uwu-tools:main Sep 5, 2023
7 checks passed
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.

Make components property configurable
4 participants