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

[WIP] added contributing.md file to assist new contributors #946

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

kernelpanic77
Copy link

Signed-off-by: kernelpanic77 shanware.ishan@gmail.com

What does this PR do?

This PR completes the addition of the contributing guidelines to the DWO repository.

What issues does this PR fix or reference?

#935

Is it tested? How?

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Signed-off-by: kernelpanic77 <shanware.ishan@gmail.com>
@openshift-ci
Copy link

openshift-ci bot commented Oct 6, 2022

Hi @kernelpanic77. Thanks for your PR.

I'm waiting for a devfile 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.

@amisevsk amisevsk requested a review from AObuchow October 6, 2022 19:34
Copy link
Collaborator

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

Thanks @kernelpanic77. I know this is WIP but I had a few initial suggestions.

docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
Comment on lines 13 to 14
(#testing-your-changes)
- [Signing-off on Commits](#signing-off-on-commits)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Accidentally duplicated lines?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, updated.

git remote -v
```

**6.** Always take a pull from the upstream repository to your master branch to keep it at par with the main project (updated repository).
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should avoid focusing on how to set up git repositories for the contributing guide -- assume the user has cloned a suitable repo to their local machine and wants to begin writing code for it. To this end, focus on

  1. What's required
  2. What the flow is for starting/debugging/testing

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I have added a "testing your changes" section for describing the general workflow of debugging and testing.

git checkout -b <your_branch_name>
```

**8.** Start the minikube cluster.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably be scoped to a "developing on minikube" section; we don't require developers use minikube. In addition, how to start/configure minikube is out of scope for this article except where required (e.g. if we needed a specific amount of memory)

Copy link
Author

Choose a reason for hiding this comment

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

Hi @amisevsk! I have added that the steps are specifically for developing the devworkspace-operator on a minikube cluster. Should I add anything else ?

Comment on lines 117 to 133
**12.** Install the dependencies for running the devworkspace-operator in your cluster.

```
make install
```

**13.** Scale down the replicas of pods to 0.

```
kubectl patch deployment/devworkspace-controller-manager --patch "{\"spec\":{\"replicas\":0}}" -n $NAMESPACE
```

**14.** Run the devworkspace-operator.

```
make run
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Structurally, this should appear in a section like "running the controller locally"; this is not the only way to contribute so we shouldn't present it as such.

Copy link
Collaborator

@AObuchow AObuchow left a comment

Choose a reason for hiding this comment

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

@kernelpanic77 looking great so far 😎 In addition to @amisevsk's review, left some minor comments and potential suggestions.

After these comments are addressed, it might be worth adding a section on developing the webhook. IIRC, this process involves:

  1. Make a change to the webhook
  2. Ensure the DWO_IMG environment variable points to your container image repository, eg. export DWO_IMG=quay.io/aobuchow/dwo-webhook:next
  3. Run make docker restart (assuming DWO is already deployed to the cluster, otherwise make docker install)
  4. Wait for the webhook deployment to update with your image that contains your latest changes.

There may be a better way to develop the webhook, but this is generally the flow that I've performed.


Follow the following instructions to start contributing.

**1.** Fork [this](https://github.com/devfile/devworkspace-operator) repository.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very minor, but I would change this to Fork the [DevWorkspace Operator](https://github.com/devfile/devworkspace-operator) repository

Copy link
Author

Choose a reason for hiding this comment

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

@kernelpanic77 looking great so far sunglasses In addition to @amisevsk's review, left some minor comments and potential suggestions.

After these comments are addressed, it might be worth adding a section on developing the webhook. IIRC, this process involves:

Thanks @AObuchow. This makes sense, I'll add a specific sub section for testing and developing webhooks in the "testing your changes" section.

  1. Make a change to the webhook
  2. Ensure the DWO_IMG environment variable points to your container image repository, eg. export DWO_IMG=quay.io/aobuchow/dwo-webhook:next
  3. Run make docker restart (assuming DWO is already deployed to the cluster, otherwise make docker install)
  4. Wait for the webhook deployment to update with your image that contains your latest changes.

There may be a better way to develop the webhook, but this is generally the flow that I've performed.

I have not contributed to developing webhooks yet 😅 , so this looks right to me. @amisevsk @ibuziuk would you like to add any steps to the process specified by @AObuchow.

export NAMESPACE="devworkspace-controller"
```

**11.** Install the kubernetes certificate management controller to generate and manage TLS certificates for your cluster.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's worth noting that the cert manager is required only for Kubernetes, so if a "developing on minikube" section of this documented is created, this should probably be specific to it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cert-manager is required for all deployments on Kubernetes, not just minikube.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, adding this comment in the steps. Thanks @AObuchow @amisevsk.

**11.** Install the kubernetes certificate management controller to generate and manage TLS certificates for your cluster.

```
make install cert-manager.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've always used make install_cert_manager as this is the rule defined here and also referenced in the README.

Though, make install cert-manager does seem to work? Not sure where this recipe is defined as I couldn't find it when grepping the repo.

Copy link
Author

Choose a reason for hiding this comment

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

yes, making the change. make install_cert_manager seems right to me as well.

make install
```

**13.** Scale down the replicas of pods to 0.
Copy link
Collaborator

@AObuchow AObuchow Oct 7, 2022

Choose a reason for hiding this comment

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

Maybe "Scale down the controller manager deployment's pods to 0."?

The reason this step is necessary is that only 1 controller manager can be run at a time (otherwise their operations will conflict/"fight" with each other), and if we are running the controller locally then we need to ensure the controller is not running on the cluster.

Copy link
Author

Choose a reason for hiding this comment

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

Noted 👍 .

make run
```

This will run the devworkspace-controller in your local cluster (minikube/openshift).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically, this will make the devworkspace-controller run locally on your system (not on your local cluster).
I would remove the mention of "(minikube/openshift)" and, as @amisevsk mentioned, make this appear in a section on running the controller locally.

Copy link
Author

Choose a reason for hiding this comment

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

Noted 👍 .

git commit -s -m "<commit subject>"
```

**17.** While you are working on your branch, other developers may update the `master` branch with their branch. This action means your branch is now out of date with the `master` branch and missing content. So to fetch the new changes, follow along:
Copy link
Collaborator

Choose a reason for hiding this comment

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

As @amisevsk mentioned, I would omit instructions on setting up git/developing with git. With that being said, for DWO the master branch is called main.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I have removed the git/developing instructions for commit instructions.


- [Contributing to Devworkspace-Operator](#contributing-to-devworkspace-operator)
- [Before You Get Started](#before-you-get-started)
- [Code of Conduct](#code-of-conduct)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if you had ideas for the "For Newcomers" section, but if you end up omitting it, it may be worth moving the code of conduct section to the end of this document (or at least, after the "How to Contribute" section).

This is just so that the contributing instructions are immediately visible (as the Code of Conduct section could be a bit lengthy).

Also, if you're looking for inspiration for a code of conduct, here's one

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, here's an even better Code of Conduct from the devfile API repo: https://github.com/devfile/api/blob/main/CODE_OF_CONDUCT.md. It's probably worth making another, separate file for the code of conduct and linking to it in the CONTRIBUTING.md

Copy link
Author

Choose a reason for hiding this comment

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

I am actually omitting the newcomer's section. As it just doesn't seem an immediate requirement for now.

docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
@openshift-ci
Copy link

openshift-ci bot commented Nov 10, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kernelpanic77
Once this PR has been reviewed and has the lgtm label, please assign amisevsk for approval by writing /assign @amisevsk in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Contributor

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

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

@kernelpanic77 thank you for your interest in the project. Would you be able to address the review comments and rebase?

kernelpanic77 and others added 2 commits January 13, 2023 22:29
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
@kernelpanic77
Copy link
Author

kernelpanic77 commented Jan 13, 2023

Hi @ibuziuk ! I apologize for the delay in addressing these comments. I am adding new commits for the changes requested by @AObuchow @amisevsk.

kernelpanic77 and others added 5 commits January 25, 2023 00:50
Signed-off-by: kernelpanic77 <shanware.ishan@gmail.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: kernelpanic77 <shanware.ishan@gmail.com>
Signed-off-by: kernelpanic77 <shanware.ishan@gmail.com>
@kernelpanic77 kernelpanic77 requested review from ibuziuk, amisevsk and AObuchow and removed request for ibuziuk and amisevsk January 24, 2023 20:19
@kernelpanic77
Copy link
Author

Hi @ibuziuk @AObuchow @amisevsk! I have reviewed comments and rebased the PR. Pls let me know if anymore changes are needed.

@amisevsk
Copy link
Collaborator

@kernelpanic77 I think something went wrong with your rebase, this PR is now showing as containing 111 commits, changing 322 files.

@kernelpanic77 kernelpanic77 changed the base branch from main to pr-update-base-images-1640124875 January 25, 2023 10:18
@kernelpanic77 kernelpanic77 changed the base branch from pr-update-base-images-1640124875 to main January 25, 2023 10:18
@kernelpanic77
Copy link
Author

kernelpanic77 commented Jan 25, 2023

@amisevsk I have fixed the issue. I changed the base branch to main.

Copy link
Collaborator

@AObuchow AObuchow left a comment

Choose a reason for hiding this comment

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

@kernelpanic77 Awesome work 😎 🙏 Looking forward to getting this merged.

I left some comments, most of the things I wrote are minor nitpicks :P

@@ -0,0 +1,126 @@
# Contributing to Devworkspace-Operator
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency with the README, the project should be referred to as "DevWorkspace Operator". @amisevsk correct me if I am wrong.

docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/CONTRIBUTING.md Outdated Show resolved Hide resolved
@kernelpanic77
Copy link
Author

Hey @AObuchow ! I have addressed the changes requested by you. Please have a look. Let's get this merged 💯

@kernelpanic77 kernelpanic77 requested review from AObuchow and removed request for JPinkney February 7, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants