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

docs: Update contributing doc #2026

Merged

Conversation

JamieDanielson
Copy link
Member

Which problem is this PR solving?

Short description of the changes

  • update pr guidelines section
  • add development quickstart
  • add more detail for general guidance
  • add tools and dev header section
  • update note about changelog
  • update contributing toc

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Merging #2026 (060a99c) into main (dfb2dff) will increase coverage by 0.00%.
Report is 17 commits behind head on main.
The diff coverage is n/a.

❗ Current head 060a99c differs from pull request most recent head f49d6b5. Consider uploading reports for the commit f49d6b5 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2026   +/-   ##
=======================================
  Coverage   90.97%   90.98%           
=======================================
  Files         146      145    -1     
  Lines        7492     7454   -38     
  Branches     1502     1488   -14     
=======================================
- Hits         6816     6782   -34     
+ Misses        676      672    -4     

see 5 files with indirect coverage changes

Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

CONTRIBUTING.md Outdated Show resolved Hide resolved

- [NPM](https://npmjs.com)
- [TypeScript](https://www.typescriptlang.org/)
- [lerna](https://github.com/lerna/lerna) to manage dependencies, compilations, and links between packages. Most lerna commands should be run by calling the provided npm scripts.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is out of date now. AFAIK lerna is only now used for (a) lerna run ... because that supports parallel execution of a command in many workspace package dirs and (b) lerna publish ... for the release process (though I'm not sure on this one).

Perhaps other devs use other lerna ... commands for their work?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll be honest, I'm not positive exactly how lerna and npm workspaces work together in this repo. I noticed lerna is still in commands in the package.json which is what led me to believe it's still in use for various things... but I do know that running lerna commands directly (instead of the npm command that calls lerna) causes problems and doesn't work as expected so I'm very much open to someone telling me what I have wrong here! 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Yah, I had hoped to drop lerna entirely when starting using npm workspaces, but npm run ... does not support the parallel running that lerna run ... does. Also lerna ... was being used -- at least I think so -- in some of the release process that I don't know well at all.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, as far as I know lerna is used to:

  • run scripts in parallel
    • lint/lint:fix
    • updating the version.ts files for the current package and all it's local dependencies
      • I wonder though: do we even need this in contrib? I know we use it in core, but I just checked and I didn't see any usages of the version file in any of our packages. Maybe it's redundant. I'll open a follow-up issue to investigate this Edit: I must have selected the wrong scope when searching for usages. It's actually quite widely used to set the instrumentation version.
  • updating versions on release (used by release-please, it might be okay with it just being there in package.json)
  • releasing the packages (lerna publish, we might be able to replace this with an npm counterpart)

CONTRIBUTING.md Outdated

The `opentelemetry-js-contrib` project is written in TypeScript.

- `npm install` to install dependencies.
As a general rule, installing and then compiling from the root directory should always be done first before anything else.
After installing and compiling from the root directory, do it again from the specific package directory you are working in.
Copy link
Contributor

Choose a reason for hiding this comment

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

do it again from the specific package directory you are working in.

Do you find that is necessary after a build at the top-level? It is after making any local changes, but not otherwise in my experience so far.

Copy link
Member Author

Choose a reason for hiding this comment

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

At this point I realized I've been doing it out of habit, so it's certainly possible that it's only necessary to do it after local changes. So maybe something like always install and compile from the root, and then install and compile in the local package after any changes are made

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, sounds better.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK I've updated to clarify this a bit better


### Tools used

- [NPM](https://npmjs.com)
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything below is automatically installed, right? Might be good to mention what versions of npm/node are supported/recommended, or possibly have something like a nvmrc file or similar?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good callout - I cheated a little to avoid this getting out-of-date, and suggested links to refer to for dev dependencies and runtimes.

Copy link
Contributor

@carlpett carlpett left a comment

Choose a reason for hiding this comment

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

I think this is a great step up! 👏

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Added some of my thoughts.
Thanks for taking the time to update this 🙂


- [NPM](https://npmjs.com)
- [TypeScript](https://www.typescriptlang.org/)
- [lerna](https://github.com/lerna/lerna) to manage dependencies, compilations, and links between packages. Most lerna commands should be run by calling the provided npm scripts.
Copy link
Member

Choose a reason for hiding this comment

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

Yes, as far as I know lerna is used to:

  • run scripts in parallel
    • lint/lint:fix
    • updating the version.ts files for the current package and all it's local dependencies
      • I wonder though: do we even need this in contrib? I know we use it in core, but I just checked and I didn't see any usages of the version file in any of our packages. Maybe it's redundant. I'll open a follow-up issue to investigate this Edit: I must have selected the wrong scope when searching for usages. It's actually quite widely used to set the instrumentation version.
  • updating versions on release (used by release-please, it might be okay with it just being there in package.json)
  • releasing the packages (lerna publish, we might be able to replace this with an npm counterpart)

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

looks good, thank you for working on this 👍

@pichlermarc pichlermarc merged commit 8015d74 into open-telemetry:main Mar 25, 2024
12 checks passed
@JamieDanielson JamieDanielson deleted the jamie.update-contrib-doc branch March 25, 2024 21:03
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.

Unable to run compile or test
4 participants