https://jira.onap.org/secure/RapidBoard.jspa?projectKey=CPS&rapidView=228
CPS Team WoW
Note | ||
---|---|---|
| ||
This section is a Work in Progress to be confirmed by team |
- User Stories are groomed by team in weekly meeting or on demand as required
- The label 'Groomed' will be added when the team agrees there is enough information in the ticket, the scope is clear and acceptance criteria are defined
- Grooming is not compulsory for Jira (sub)tasks (not affecting source code)
- Backlog should be in priority order.
- Check bugs first, unless specially agreed they always have the highest priority
- Check the next available user story is 'Groomed' and there are no blocking dependencies
- if it not groomed but seems to be next in line, call a quick meeting with PTL and available team members to groom it as soon as is practical
- Check with PTL if story can be taken as there could always be last minute updates or changes that might prioritize a different task
- Inform team bout you intention to take user story
- Assign user story to yourself
- Set user story to In progress! (even if starting with some study first)
- If required (typically agreed during grooming) create a Implementation Proposal page here: Implementation Proposals
- You might find a proposal is needed anyway and help you code and share intention for code solution with team and or address specific issues that are discovered during implementation phase
- Implementation Proposals are also good for knowledge sharing with the team and a quick meeting about it might be required depending on the nature of the user story
- Implementation Proposals can also serve as permanent developer documentation and might require further addition e.g. for CPS Exceptions and REST API HTTP Response Codes
- Sub task(s) can be created to track the work (especially for larger user stories) and/or delegate but this is optional
- Commit early and frequently
- It is always good to give the team a heads up and share early!
- The WiP flag in Gerrit can be used to indicate that review is not ready for review with a fine toothcomb yet
- All java code commits should be accompanied with test ware covering the new or modified code (unless agreed by team to handle it in a separate commit in special circumstances)
- Review quick and fast, none of like context switching but we cant have developer sitting and waiting for reviews either, try to balance this!
- Depending on the user story a demo might be required before it can be closed
- Demos should be recorded and added to CPS User Story Demos
Code, Merge requirements and Jira updates are further detailed in next few sections
JIRA Status Updates
Move To | When |
---|---|
In-progress | The moment you start working on it (incl. analysis) |
Submitted | The review is merged, merge & CICD jobs are successful. |
Closed | Documentations are updated. Complete demo to team. |
Committer Strategy
- Each review requires 2 committers to +1 and/or +2.
- A +2 from committer or PTL have the permissions to merge code.
- See also Committer Best Practices
Merge and +2 committers:
Code Requirements
- Copyright included in each file. Apache 2 for coding files.
- The Copyright line for contributing organization inserted or updated reflecting the contribution year.
- A LICENSE.txt file placed at the root of the repo to provide umbrella coverage.
- Unit testing coverage > 90% using Persistence Layer Testing and Groovy & Spock
- We will follow ONAP Recommended Software Development Best Practices: Developer Best Practices
- Setting Up Your Development Environment details a general set up for ONAP projects. Please note the CPS Specific requirements below!
CPS Specific Code Style set up
- InteliJ IDE: As we have noticed some slight formatting issues that are not controlled by the IDE we prefer that CPS contributors use IntelliJ (community edition is perfectly good for Java development)
- CPS CheckStyle Scheme: CPS as extended the standard ONAP CheckStyle configuration. Once you have downloaded CPS you can find the definition in <your_git_folder>checkstyle/src/main/resources/cps-java-style.xml
- Groovy: CPS uses Groovy/Spock for unit testing. There is some additional formatting setup to ensure consistent formatting of Groovy files.
Configure CPS code CheckStyle Plugin for IntelliJ
- Select, File, Settings, Tools, Checkstyle
- Click on + beside the 'Configuration File' box to add a configuration
- Set description to something like 'ONAP Rules'
- Click on Browse to select the file <your_git_folder>checkstyle/src/main/resources/cps-java-style.xml
- Complete the Wizard (you can set exclusion properties if needed)
- Activate the Configuration File you just added by selecting the relevant checkbox
- optional: Click [OK] to close the settings popup
Configure CPS code style auto formatting for IntelliJ (using the same CheckStyle rules and automating it for you )
- Select, File, Settings, Editor, Code Style
- Click on the gear icon at the end of the line for "Scheme:"
- Optional: As importing a schema overrides the current scheme you might want to first use the 'Duplicate..' and 'Rename...' options to create an easily identifiable scheme e.g. 'CPS Standard'
- Import Scheme→Checkstyle Configuration
- Click on Browse to select the file <your_git_folder>checkstyle/src/main/resources/cps-java-style.xml
- optional: Click [OK] to close the settings popup
Configure CPS Java code style auto formatting for IntelliJ
- Select, File, Settings, Editor, Code Style, Java
- Ensure the same scheme is selected (as suggested in step 3 in the previous instructions: 'CPS Standard')
- Select 'Tabs and Indents' tab
- Set 'Tab size' to 4
- Set 'Indent' to 4
- Set 'Continuation indent' to 8
- Set 'Label indent' to 0
- Select 'Imports' tab
- Set 'Class count to use import with '*'' to 999
- Set 'Names count to use static import with '*'' to 999
- Click [OK] to close the settings popup
Configure CPS Groovy code style auto formatting for IntelliJ
- Select, File, Settings, Editor, Code Style, Groovy
- Ensure the same scheme is selected (as suggested in step 3 in the previous instructions: 'CPS Standard')
- Select 'Tabs and Indents' tab
- Set 'Tab size' to 4
- Set 'Indentt' to 4
- Set 'Continuation indent' to 8
- Set 'Label indent' to 4
- Select 'Imports' tab
- Set 'Class count to use import with '*'' to 999
- Set 'Names count to use static import with '*'' to 999
- Click [OK] to close the settings popup
Code Submissions
- Any CheckStyle issues must be fixed in current review.
- Code must be covered by tests.
- We are currently in the process of setting up sonarqube to check our code coverage. Please use the sonarqube plugin for now to measure coverage. To setup sonarqube see dev setup guide: Setting Up Your Development Environment#LocalSonarQubeSetup
- Mark the review as WIP if it is not ready for review.
- Commit message must be in the following format:
Comment explaining what is the purpose of the code. Issue-ID: CPS-1 |
Code Analysis
We recommend that most user stories are accompanied with small wiki page to document/clarify some analysis for that user story.
Unit Test
CPS is promoting Groovy and Spock for our unit test. All new modified code should include good quality test
see Groovy & Spock you can also contact the PTL Toine Siebelink for more details
User Story Demos
As part of our best practice to finish a user story it should be demonstrated to team and if possible recorded
Jenkins Job
ONAP uses Jenkins based CICD tool chain. However, contributors are only given read access to the Jenkins servers. All jobs are created by automatic generation from JJB definitions.
https://jenkins.onap.org./view/cps/
Bug reporting
Vulnerability report process
If you find any vulnerability please email the security contact with the information that you have.
The security contact is ; toine.siebelink@est.tech
We will give credit to anyone who reports a vulnerability so that we can fix it. If you wish to remain anonymous instead, please let us know and we will respect that.