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

obs: add library functions - 01 #251

Merged

Conversation

nitishfy
Copy link
Member

@nitishfy nitishfy commented Sep 20, 2023

Reference: kubernetes/sig-release#2295

  • Add the library functions to interact with OBS.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 20, 2023
@k8s-ci-robot k8s-ci-robot added sig/release Categorizes an issue or PR as relevant to SIG Release. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 20, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @nitishfy. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 20, 2023
obs/project.go Outdated
Architectures []string `json:"arch" xml:"arch"`
ReleaseTargets []ReleaseTarget `json:"releasetarget,omitempty" xml:"releasetarget,omitempty"`
Architectures []string `json:"architectures" xml:"arch"`
ReleaseTargets []ReleaseTarget `json:"releaseTarget,omitempty" xml:"releasetarget,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

why this change?

Copy link
Member

Choose a reason for hiding this comment

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

@cpanato I proposed this change in the previous PR. JSON works in a bit different way than XML. For example, you don't have arrays in XML, but you have arrays in JSON. Because of that, I would prefer that JSON tags are called same as fields, i.e. plural and camel-case. In my opinion, in the JSON world, architectures is more natural than arch

obs/project.go Outdated Show resolved Hide resolved
obs/project.go Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Show resolved Hide resolved
@xmudrii
Copy link
Member

xmudrii commented Sep 20, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 20, 2023
@xmudrii
Copy link
Member

xmudrii commented Sep 20, 2023

/test all

obs/project.go Outdated Show resolved Hide resolved
@nitishfy
Copy link
Member Author

Update: Ready for the next set of review

@nitishfy nitishfy requested review from xmudrii and cpanato September 21, 2023 11:37
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 21, 2023
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
@xmudrii
Copy link
Member

xmudrii commented Sep 23, 2023

/test all

1 similar comment
@xmudrii
Copy link
Member

xmudrii commented Sep 24, 2023

/test all

Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

Generally looks fine, some minor nits

obs/error.go Outdated Show resolved Hide resolved
obs/error.go Outdated
}

func (e *APIError) Error() string {
return fmt.Sprintf("HTTP status %d: %s (%s)", e.HTTPStatusCode, e.XMLStatusCode, e.Message)
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to have a different error message if HTTP status code is 0?

Copy link
Member Author

Choose a reason for hiding this comment

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

we generally have the message as unable to generate the request.

obs/error.go Show resolved Hide resolved
@nitishfy nitishfy force-pushed the Nitish/obs-crud-operations branch from 497bdfb to 462a5f7 Compare September 24, 2023 18:07
@xmudrii
Copy link
Member

xmudrii commented Sep 24, 2023

/test all

@nitishfy
Copy link
Member Author

when we are trying to build the Read function for library, what do we actually expect from it? Is it to display the Project meta?

@nitishfy nitishfy requested a review from xmudrii September 26, 2023 10:16
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Show resolved Hide resolved
obs/project.go Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
@nitishfy
Copy link
Member Author

/test all

@nitishfy nitishfy changed the title obs: add library functions obs: add library functions - 01 Sep 26, 2023
@nitishfy nitishfy requested a review from xmudrii September 26, 2023 14:42
obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
@nitishfy nitishfy force-pushed the Nitish/obs-crud-operations branch from e868220 to 07ec6b9 Compare September 26, 2023 15:30
@xmudrii
Copy link
Member

xmudrii commented Sep 28, 2023

/test all

Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

Some lint error, please address these errors

obs/project.go Outdated Show resolved Hide resolved
obs/project.go Outdated Show resolved Hide resolved
Signed-off-by: NitishKumar06 <[email protected]>
@nitishfy nitishfy requested a review from xmudrii September 29, 2023 13:53
@nitishfy
Copy link
Member Author

/test all

@nitishfy nitishfy marked this pull request as ready for review September 29, 2023 14:33
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 29, 2023
Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nitishfy, xmudrii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 29, 2023
@k8s-ci-robot k8s-ci-robot merged commit ca307ed into kubernetes-sigs:main Sep 29, 2023
@nitishfy nitishfy deleted the Nitish/obs-crud-operations branch September 29, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants