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 initial Project types #246

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

nitishfy
Copy link
Member

@nitishfy nitishfy commented Sep 13, 2023

Reference: #2295
This PR is created with the purpose of adding the initial project structure for the OBS project meta file for golang library

@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 13, 2023
@k8s-ci-robot k8s-ci-robot requested a review from cici37 September 13, 2023 17:36
@k8s-ci-robot k8s-ci-robot added the sig/release Categorizes an issue or PR as relevant to SIG Release. label Sep 13, 2023
@k8s-ci-robot k8s-ci-robot requested a review from jrsapi September 13, 2023 17:36
@k8s-ci-robot
Copy link
Contributor

Welcome @nitishfy!

It looks like this is your first PR to kubernetes-sigs/release-sdk 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/release-sdk has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 13, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 13, 2023
obs/obs.go Outdated Show resolved Hide resolved
Copy link
Member Author

@nitishfy nitishfy left a comment

Choose a reason for hiding this comment

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

General question answered

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.

Here's the initial review, I can do another review once these comments are addressed. Looks pretty solid so far!

.gitignore Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
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.

Looks better, some more nits from my side

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

I think I can move forward with adding more features now. Let me know if you have any more feedback to address, I'll resolve them along the way.

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 final nits for now. Perhaps we can merge this PR once these nits are addressed.

obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated
Comment on lines 12 to 14
Title *string `json:"title" xml:"title,omitempty"`
Description *string `json:"description" xml:"description,omitempty"`
URL *string `json:"url" xml:"url,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I changed my mind about these fields. Let's make this field non-pointer string and remove omitempty. We're actually going to get the same result.

Copy link
Member Author

Choose a reason for hiding this comment

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

but how is this working internally then?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I fully understand your question. Can you elaborate please?

Copy link
Member Author

Choose a reason for hiding this comment

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

mhh, why is there need to remove the pointers and omitempty from here? (these fields are after all not mandatory, isn't it?)

Copy link
Member

Choose a reason for hiding this comment

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

Because working with string pointers (or with any other pointer to a primitive type) is a little bit complicated and doesn't provide good user experience. When defining the struct, you have to do something like this:

str := "My Project Name"
p := &Project{
    URL: &str,
}

Instead of:

p := &Project{
    URL: "My Project Name",
}

When you have multiple strings, like in our case, it gets even worse.

Right now, if you completely omit the URL when defining a project, you'll get XML like this one:

<project>
    ...
</project>

If you remove pointers and omitempty, you'll get XML like this one:

<project>
    <url></url>
</project>

These two XMLs are practically the same. OBS is even going to remove the empty tags automatically. However, the user experience of using the library is much better in the second case (when not using pointers to primitive types).

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

xmudrii commented Sep 14, 2023

/test all

@xmudrii
Copy link
Member

xmudrii commented Sep 14, 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 14, 2023
@xmudrii
Copy link
Member

xmudrii commented Sep 14, 2023

/assign @saschagrunert @cpanato
PTAL at this PR :)

@xmudrii
Copy link
Member

xmudrii commented Sep 14, 2023

/retitle obs: add initial Project types

@k8s-ci-robot k8s-ci-robot changed the title [WIP] LFX Mentorship: Building a Golang Library obs: add initial Project types Sep 14, 2023
obs/obs.go Outdated Show resolved Hide resolved
@nitishfy nitishfy force-pushed the Nitish/lfx-mentorship branch from 15318a1 to ad210a9 Compare September 14, 2023 18:44
@nitishfy nitishfy marked this pull request as ready for review September 14, 2023 18:44
@k8s-ci-robot k8s-ci-robot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 14, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 14, 2023
@nitishfy nitishfy requested a review from xmudrii September 14, 2023 18:46
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
obs/obs.go Outdated Show resolved Hide resolved
@nitishfy nitishfy requested a review from xmudrii September 15, 2023 14:15
@nitishfy
Copy link
Member Author

Update: PR is ready for the next set of review and probably for merge as well.
cc: @saschagrunert @cpanato

@nitishfy nitishfy force-pushed the Nitish/lfx-mentorship branch from d9afd36 to 3b5dece Compare September 15, 2023 17:16
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 nits, but let's address these nits in a follow-up.
/lgtm
/approve

obs/project.go Show resolved Hide resolved
obs/project.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 15, 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 15, 2023
@k8s-ci-robot k8s-ci-robot merged commit 4e4f1d8 into kubernetes-sigs:main Sep 15, 2023
@nitishfy nitishfy deleted the Nitish/lfx-mentorship branch September 16, 2023 06:05
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants