Skip to content

Commit

Permalink
Add the development process
Browse files Browse the repository at this point in the history
  • Loading branch information
nuolin committed Nov 4, 2024
1 parent c15093e commit c18e873
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ pulsar-java-contrib is actively in development. If you have some common use cas
Please [open an issue](https://github.com/apache/pulsar-java-contrib/issues/new) to share your idea or
suggestion. PRs are always welcome and greatly appreciated, but for larger functional changes a pre-coding introduction
can be helpful to ensure this is the correct place and that active or conflicting efforts don't exist.

## Development Process
Compared with [pulsar](https://github.com/apache/pulsar) , [pulsar-java-contrib](https://github.com/apache/pulsar-java-contrib) is faster, and there is no need to send emails for DISCUSSION and VOTE.
it can be summarized as follows:
1. for simple changes, you only need to submit a PR for code changes
2. for larger improvement proposal, you need to submit a PR for code changes + a design document (the file is placed in pcip/pcip-xxx.md)
For detailed development process description, see: pcip/README.md
90 changes: 90 additions & 0 deletions pcip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Pulsar Java Contrib Improvement Proposal (PCIP)

## What is a PCIP?

The PCIP is a "Pulsar Java Contrib Improvement Proposal" and it's the mechanism used to propose changes to the Apache Pulsar Java Contrib codebases.

The changes might be in terms of new features, large code refactoring, changes to APIs.

In practical terms, the PCIP defines a process in which developers can submit a design doc, receive feedback and get the "go ahead" to execute.


### What is the goal of a PCIP?

There are several goals for the PCIP process:

1. Ensure community technical discussion of major changes to the Apache Pulsar codebase.

2. Provide clear and thorough design documentation of the proposed changes. Make sure every Pulsar developer will have enough context to effectively perform a code review of the Pull Requests.

3. Use the PCIP document to serve as the baseline on which to create the documentation for the new feature.

4. Have greater scrutiny to changes are affecting the public APIs (as defined below) to reduce chances of introducing breaking changes or APIs that are not expressing an ideal semantic.

It is not a goal for PCIP to add undue process or slow-down the development.

### When is a PCIP required?

* Any new feature for Pulsar brokers or client
* Any change to the public APIs (Client APIs, REST APIs, Plugin APIs)
* Any change to the wire protocol APIs
* Any change to the API of Pulsar CLI tools (eg: new options)
* Any change to the semantic of existing functionality, even when current behavior is incorrect.
* Any large code change that will touch multiple components
* Any changes to the metrics (metrics endpoint, topic stats, topics internal stats, broker stats, etc.)
* Any change to the configuration

### When is a PCIP *not* required?

* Bug-fixes
* Simple enhancements that won't affect the APIs or the semantic
* Small documentation changes
* Small website changes
* Build scripts changes (except: a complete rewrite)

### Who can create a PCIP?

Any person willing to contribute to the Apache Pulsar project is welcome to create a PCIP.

## How does the PCIP process work?

A PCIP proposal can be in these states:
1. **DRAFT**: (Optional) This might be used for contributors to collaborate and to seek feedback on an incomplete version of the proposal.

2. **DISCUSSION**: The proposal has been submitted to the community for feedback and approval.

3. **ACCEPTED**: The proposal has been accepted by the Pulsar project.

4. **REJECTED**: The proposal has not been accepted by the Pulsar project.

5. **IMPLEMENTED**: The implementation of the proposed changes have been completed and everything has been merged.

6. **RELEASED**: The proposed changes have been included in an official
Apache Pulsar release.


The process works in the following way:

1. Fork https://github.com/apache/pulsar-java-contrib repository (Using the fork button on GitHub).
2. Clone the repository, and on it, copy the file `pcip/TEMPLATE.md` and name it `pcip-xxx.md`. The number `xxx` should be the next sequential number after the last contributed PCIP. You view the list of contributed PIPs (at any status) as a list of Pull Requests having a "PCIP" label. Use the link [here](https://github.com/apache/pulsar-java-contrib/pulls?q=is%3Apr+label%3APCIP+) as shortcut.
3. Write the proposal following the section outlined by the template and the explanation for each section in the comment it contains (you can delete the comment once done).
* If you need the diagrams, please create a folder named pcip-XXX under the [pcip/static/img](https://github.com/apache/pulsar-java-contrib/tree/master/pcip/static/img) path and put the images in.
4. Create GitHub Pull request (PR). The PR title should be `[improve][pcip] PCIP-xxx: {title}`, where the `xxx` match the number given in previous step (file-name). Replace `{title}` with a short title to your proposal.
*Validate* again that your number does not collide, by step (2) numbering check.
5. Based on the discussion and feedback, some changes might be applied by authors to the text of the proposal. They will be applied as extra commits, making it easier to track the changes.

To speed up the development process:
1. you can put the code changes and design documents(pcip/pcip-xxx.md) in one PR.
2. If the code is not yet developed, you can include only a design document(pcip/pcip-xxx.md) in the PR and submit the code separately after the development is completed.

## List of PCIPs

### Historical PCIPs
You can the view list of PCIPs previously managed by GitHub [here](https://github.com/apache/pulsar-java-contrib/tree/master/pcip)

### List of PCIPs
1. You can view all PCIPs (besides the historical ones) as the list of Pull Requests having title starting with `[improve][pcip] PCIP-`. Here is the [link](https://github.com/apache/pulsar-java-contrib/pulls?q=is%3Apr+title%3A%22%5Bpcip%5D%5Bdesign%5D+PCIP-%22) for it.
- Merged PR means the PCIP was accepted.
- Closed PR means the PCIP was rejected.
- Open PR means the PCIP was submitted and is in the process of discussion.
2. You can also take a look at the file in the `pcip` folder. Each one is an approved PCIP.
174 changes: 174 additions & 0 deletions pcip/TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<!--
RULES
* Never place a link to an external site like Google Doc. The proposal should be in this issue entirely.
* Use a spelling and grammar checker tools if available for you (there are plenty of free ones).
PROPOSAL HEALTH CHECK
I can read the design document and understand the problem statement and what you plan to change *without* resorting to a couple of hours of code reading just to start having a high level understanding of the change.
IMAGES
If you need the diagrams, please create a folder named pcip-XXX under the [pcip/static/img](https://github.com/apache/pulsar-java-contrib/tree/master/pcip/static/img) path and put the images in.
THIS COMMENTS
Please remove them when done.
-->

# PCIP-XXX: Proposal title

# Background knowledge

<!--
Describes all the knowledge you need to know in order to understand all the other sections in this PCIP
* Give a high level explanation on all concepts you will be using throughout this document. For example, if you want to talk about Persistent Subscriptions, explain briefly (1 paragraph) what this is. If you're going to talk about Transaction Buffer, explain briefly what this is.
If you're going to change something specific, then go into more detail about it and how it works.
* Provide links where possible if a person wants to dig deeper into the background information.
DON'T
* Do not include links *instead* explanation. Do provide links for further explanation.
EXAMPLES
* See [PCIP-248](https://github.com/apache/pulsar/issues/19601), Background section to get an understanding on how you add the background knowledge needed.
(They also included the motivation there, but ignore it as we place that in Motivation section explicitly).
-->

# Motivation

<!--
Describe the problem this proposal is trying to solve.
* Explain what is the problem you're trying to solve - current situation.
* This section is the "Why" of your proposal.
-->

# Goals

## In Scope

<!--
What this PCIP intend to achieve once It's integrated into Pulsar.
Why does it benefit Pulsar.
-->

## Out of Scope

<!--
Describe what you have decided to keep out of scope, perhaps left for a different PCIP/s.
-->


# High Level Design

<!--
Describe the design of your solution in *high level*.
Describe the solution end to end, from a birds-eye view.
Don't go into implementation details in this section.
I should be able to finish reading from beginning of the PCIP to here (including) and understand the feature and
how you intend to solve it, end to end.
DON'T
* Avoid code snippets, unless it's essential to explain your intent.
-->

# Detailed Design

## Design & Implementation Details

<!--
This is the section where you dive into the details. It can be:
* Concrete class names and their roles and responsibility, including methods.
* Code snippets of existing code.
* Interface names and its methods.
* ...
-->

## Public-facing Changes

<!--
Describe the additions you plan to make for each public facing component.
Remove the sections you are not changing.
Clearly mark any changes which are BREAKING backward compatability.
-->

### Public API
<!--
When adding a new endpoint to the REST API, please make sure to document the following:
* path
* query parameters
* HTTP body parameters, usually as JSON.
* Response codes, and for each what they mean.
For each response code, please include a detailed description of the response body JSON, specifying each field and what it means.
This is the place to document the errors.
-->

### Binary protocol

### Configuration

### CLI

### Metrics

<!--
For each metric provide:
* Full name
* Description
* Attributes (labels)
* Unit
-->


# Monitoring

<!--
Describe how the changes you make in this proposal should be monitored.
Don't describe the detailed metrics - they should be at "Public-facing Changes" / "Metrics" section.
Describe how the user will use the metrics to monitor the feature: Which alerts they should set up, which thresholds, ...
-->

# Security Considerations
<!--
A detailed description of the security details that ought to be considered for the PCIP. This is most relevant for any new HTTP endpoints, new Pulsar Protocol Commands, and new security features. The goal is to describe details like which role will have permission to perform an action.
An important aspect to consider is also multi-tenancy: Does the feature I'm adding have the permissions / roles set in such a way that prevent one tenant accessing another tenant's data/configuration? For example, the Admin API to read a specific message for a topic only allows a client to read messages for the target topic. However, that was not always the case. CVE-2021-41571 (https://github.com/apache/pulsar/wiki/CVE-2021-41571) resulted because the API was incorrectly written and did not properly prevent a client from reading another topic's messages even though authorization was in place. The problem was missing input validation that verified the requested message was actually a message for that topic. The fix to CVE-2021-41571 was input validation.
If there is uncertainty for this section, please submit the PCIP and request for feedback on the mailing list.
-->

# Backward & Forward Compatibility

## Upgrade

<!--
Specify the list of instructions, if there are such, needed to perform before/after upgrading to Pulsar version containing this feature.
-->

## Downgrade / Rollback

<!--
Describe a cookbook detailing the steps required to rollback Pulsar to previous version *without* this feature.
-->

## Pulsar Geo-Replication Upgrade & Downgrade/Rollback Considerations

<!--
Describe what needs to be considered in Pulsar Geo-Replication in the upgrade and possible downgrade/rollback of this feature.
-->

# Alternatives

<!--
If there are alternatives that were already considered by the authors or, after the discussion, by the community, and were rejected, please list them here along with the reason why they were rejected.
-->

# General Notes

# Links

<!--
Updated afterwards
-->
* Mailing List discussion thread:
* Mailing List voting thread:
Binary file added pcip/static/img/pcip-{xxx}-img-{x}.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c18e873

Please sign in to comment.