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

Coding guidelines for external contributions #2634

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ashmeenkaur
Copy link
Collaborator

Description

Added coding guidelines for external contributions.

Link to the issue in case of a bug fix.

NA

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

@ashmeenkaur ashmeenkaur force-pushed the coding_guidelines branch 2 times, most recently from a145ccc to 4b260a1 Compare October 28, 2024 07:15
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.55%. Comparing base (61ee76d) to head (afac008).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2634      +/-   ##
==========================================
- Coverage   77.58%   77.55%   -0.04%     
==========================================
  Files         109      109              
  Lines       15555    15555              
==========================================
- Hits        12068    12063       -5     
- Misses       2973     2977       +4     
- Partials      514      515       +1     
Flag Coverage Δ
unittests 77.55% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/dev_guide.md Show resolved Hide resolved
docs/dev_guide.md Show resolved Hide resolved
@kislaykishore kislaykishore requested review from a team, kislaykishore and gargnitingoogle and removed request for a team and kislaykishore October 28, 2024 08:00
@ashmeenkaur ashmeenkaur marked this pull request as ready for review October 28, 2024 08:01
@ashmeenkaur ashmeenkaur requested a review from a team as a code owner October 28, 2024 08:01
@ashmeenkaur ashmeenkaur removed the request for review from gargnitingoogle October 28, 2024 08:01
docs/dev_guide.md Outdated Show resolved Hide resolved
docs/dev_guide.md Outdated Show resolved Hide resolved
help output.
* This signals to users that the feature is in development and may change or be
removed.
* After the feature development is complete, developers should open a GitHub
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also should add some rationale on when to add composite or end to end tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think there is no clear distinction and both needs to be added for new features. I've added some details, PTAL.

Tulsishah
Tulsishah previously approved these changes Oct 28, 2024
GODEBUG=asyncpreemptoff=1 CGO_ENABLED=0 go test ./tools/integration_tests/$TEST_PACKAGE_NAME/... -p 1 -short --integrationTest -v --testbucket=$TEST_BUCKET_NAME --timeout=60m -run $TEST_NAME
```
4. **Run all tests as pre-submit:** You can run existing GCSFuse end-to-end
tests as a pre-submit by adding `execute-integration-tests` label to the pull
Copy link
Collaborator

@Tulsishah Tulsishah Oct 29, 2024

Choose a reason for hiding this comment

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

External user will not be able to add any label on the PR. We have to provide go test command or steps to run our e2e test script locally.

Alternatively, If this is possible we could configure a system to automatically apply the label when a pull request (PR) is marked as "ready for review." e.g. https://github.com/apps/trusted-contributions-gcf

Copy link
Collaborator Author

@ashmeenkaur ashmeenkaur Nov 4, 2024

Choose a reason for hiding this comment

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

Thanks for catching this. I will change to "Ask GCSFuse team to apply execute-integration-tests label."

Copy link
Collaborator

Choose a reason for hiding this comment

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

Although they'll not be able to see which test fails on their PR. They won't be able to access fusion link. Better to share command to tests on them self

docs/dev_guide.md Outdated Show resolved Hide resolved
docs/dev_guide.md Outdated Show resolved Hide resolved
docs/dev_guide.md Outdated Show resolved Hide resolved
docs/dev_guide.md Outdated Show resolved Hide resolved
docs/dev_guide.md Outdated Show resolved Hide resolved

Rollout of any new feature should be done in 2 phases:

**1. Experimental Phase:**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where will we keep/document features in experimental phase and their flags? I dont want to document them on public docs, so can we have a doc under contributing that shows all contributed features and their status? And ask users to update that as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IMO, this yaml file (which we use to generate flag/config code) should serve the purpose of documentation too: https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/cfg/params.yaml

"experimental" prefix in the flag-name: and hide-flag: parameter should convey the status.


**1. Experimental Phase:**

* New features should initially be introduced behind an experimental flag. These
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add make some text here to link to the section below of Adding a CLI/Config flag.

GCSFuse even during the experimental phase. This helps ensure the
feature's stability, identify potential issues early, and prevent
regressions.
* Add unit tests for all new code written for the experimental feature. This
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add link to the section below of unit tests

regressions.
* Add unit tests for all new code written for the experimental feature. This
includes testing edge cases, boundary conditions, and error handling.
* Add composite tests to validate GCSFuse's end user functionality while
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to composite and end to end.

mainline, the feature will roll out as an experimental feature in the next
GCSFuse release with the feature disabled by default.

* Developers should open a GitHub issue (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the developers create a new github issue in addition to the one they started created before they started the experimental changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants