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

invert npmignore to include what we want #4605

Merged
merged 23 commits into from
Mar 23, 2022
Merged

Conversation

trusktr
Copy link
Contributor

@trusktr trusktr commented Dec 17, 2021

Closes #4641

re: #4511 (comment)

Describe your changes:

instead of excluding a set of files that is more likely to change over time (f.e. ops files, build scripts, ci configs, etc)

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Unit tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue?

To test, use npm pack to create a tar file, then verify the contents.

Reviewer Checklist

  • Changes appear to address issue?
  • Changes appear not to be breaking changes?
  • Appropriate unit tests included?
  • Code style and in-line documentation are appropriate?
  • Commit messages meet standards?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

@trusktr trusktr mentioned this pull request Dec 17, 2021
@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #4605 (2bb4a07) into master (9643dbe) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 2bb4a07 differs from pull request most recent head fe0a0a8. Consider uploading reports for the commit fe0a0a8 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4605      +/-   ##
==========================================
- Coverage   50.16%   50.15%   -0.02%     
==========================================
  Files         513      513              
  Lines       18830    18830              
  Branches     1664     1664              
==========================================
- Hits         9447     9444       -3     
- Misses       8965     8969       +4     
+ Partials      418      417       -1     
Impacted Files Coverage Δ
src/api/objects/ObjectAPI.js 91.16% <0.00%> (-2.21%) ⬇️
src/ui/inspector/details/Properties.vue 60.71% <0.00%> (-1.79%) ⬇️
src/plugins/imagery/components/ImageryTimeView.vue 71.83% <0.00%> (-0.58%) ⬇️
...c/plugins/persistence/couch/CouchObjectProvider.js 82.22% <0.00%> (+0.44%) ⬆️
src/plugins/timeConductor/ConductorHistory.vue 51.06% <0.00%> (+2.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dad0768...fe0a0a8. Read the comment docs.

@trusktr
Copy link
Contributor Author

trusktr commented Dec 17, 2021

How is it that this increases test coverage?

@unlikelyzero
Copy link
Collaborator

@trusktr looks good to me. Let's wait until we get the stray .spec.js file removed, update this pr, and then merge. PRs have a habit of getting merged out of order sometimes.

@unlikelyzero
Copy link
Collaborator

@shefalijoshi please take a look at this with @trusktr . This pattern seems to be far more sustainable.

@trusktr
Copy link
Contributor Author

trusktr commented Dec 17, 2021

I believe this PR can be merged separately from fixing that test. The pull request that fixes that test would have to remove the line with .spec.js from the npmignore.

Copy link
Collaborator

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

LGTM. Needs Shefali's approval and the two lines removed

.npmignore Outdated Show resolved Hide resolved
@trusktr
Copy link
Contributor Author

trusktr commented Jan 4, 2022

@shefalijoshi @unlikelyzero I removed the no-longer-needed line, and also added a # TODO

/src/**/*Spec.js
/src/**/test/
# TODO move test utils into test/ folders
/src/utils/testing.js
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wdyt think about this TODO?

Copy link
Contributor Author

@trusktr trusktr Jan 4, 2022

Choose a reason for hiding this comment

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

/src/utils/testing.js was previously being published to npm.

I added a /src/**/test/ rule ignore anything in test/ folders. It would make sense to put all test files (apart from the specs files that may be co-located with the thing they test) in test/ folders, to make it easier to ignore them without having to modify npmignore.

We can add one-off rules for specific test files to ignore as we go, but I think it would be better to have the test/ folder convention, otherwise it's the same problem this PR aimed to eliminate (but in reverse).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@trusktr maybe we could file an issue for that chance and include a link to that issue in this comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

We have a naming convention of Spec. why can't we use that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shefalijoshi Yes, true that, but multiple spec files like to import test-specific utilities from src/utils/testing.js so I had to specifically ignore that file because it isn't following a catch-all convention. So what I meant above is that instead we could move that file to src/test/utils.js instead, and that way it will fall under the src/**/test/* catch-all instead of having a one-off entry in npmignore.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do go with this approach, we should add example to this too. It has eventGenerator and generator which a lot of people use to demo OpenMCT

Copy link
Contributor

Choose a reason for hiding this comment

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

If we do go with this approach, we should add example to this too. It has eventGenerator and generator which a lot of people use to demo OpenMCT

@trusktr Please include the example, docs folders and Contributing.md, API.md, app.js as well.
What is the procfile used for?

Copy link
Contributor Author

@trusktr trusktr Jan 31, 2022

Choose a reason for hiding this comment

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

We want to publish all those things in the package on NPM? I figured people can go to the repo for that stuff. People don't normally look for that stuff in node_modules. EDIT: Oh I see @scottbell, so some people will want to import from examples.

Copy link
Contributor Author

@trusktr trusktr Jan 31, 2022

Choose a reason for hiding this comment

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

Do people consume app.js from node_modules? My understanding is we want to obliterate app.js ( @akhenry) and I think it is a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the procfile used for?

https://www.google.com/search?q=procfile&oq=procfile&aqs=edge..69i57.870j0j1&sourceid=chrome&ie=UTF-8

Not sure why we need that. Are we using it on some service? If some downstream project needs it, they should have that in their repo instead.

@trusktr trusktr requested review from unlikelyzero and shefalijoshi and removed request for shefalijoshi January 4, 2022 19:23
@trusktr
Copy link
Contributor Author

trusktr commented Jan 4, 2022

To test, use npm pack to create a tar file, then verify the contents.

unlikelyzero
unlikelyzero previously approved these changes Jan 4, 2022
Copy link
Collaborator

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

LGTM. I had one suggested change that won't block the merge. Shefali is the release manager so she should give the final 👍

/src/**/*Spec.js
/src/**/test/
# TODO move test utils into test/ folders
/src/utils/testing.js
Copy link
Collaborator

Choose a reason for hiding this comment

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

@trusktr maybe we could file an issue for that chance and include a link to that issue in this comment?

@trusktr
Copy link
Contributor Author

trusktr commented Mar 22, 2022

maybe we could file an issue for that chance and include a link to that issue in this comment?

@unlikelyzero made a new issue #4972

@trusktr
Copy link
Contributor Author

trusktr commented Mar 22, 2022

@shefalijoshi wrote:

Please include the example, docs folders and Contributing.md, API.md, app.js as well.

Do we need to includes all those? Looking for thoughts. Will put a checkbox next to the ones to include

  • app.js: Andrew expressed we should remove, and I agree
  • examples folder: do people consume stuff by importing from node_modules/openmct/examples? If not, then they can run examples from the git repo after cloning it
  • docs folder: people can see that in the repo, and on the website, so it doesn't seem we need to ship it to the package registry
  • contributing.md: also visible in the repo, where contributors will be going to contribute anyway.

@unlikelyzero
Copy link
Collaborator

unlikelyzero commented Mar 22, 2022

Do we need to includes all those? Looking for thoughts. Will put a checkbox next to the ones to include

app.js: Andrew expressed we should remove, and I agree
examples folder: do people consume stuff by importing from node_modules/openmct/examples? If not, then they can run examples from the git repo after cloning it
docs folder: people can see that in the repo, and on the website, so it doesn't seem we need to ship it to the package registry
contributing.md: also visible in the repo, where contributors will be going to contribute anyway.

App.js has a removal ticket here: #4922 if something needs to be removed, we could also remove at that time.

shefalijoshi
shefalijoshi previously approved these changes Mar 22, 2022
Copy link
Contributor

@shefalijoshi shefalijoshi 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 to me.

@shefalijoshi shefalijoshi enabled auto-merge (squash) March 22, 2022 23:25
.npmignore Outdated Show resolved Hide resolved
@scottbell
Copy link
Contributor

scottbell commented Mar 23, 2022

* [ ]  examples folder: do people consume stuff by importing from `node_modules/openmct/examples`? If not, then they can run examples from the git repo after cloning it

I'm not sure as I don't have data to say one way or another, but the Sin Wave, State, and Event generator seem to get a lot of use in openmct deployments.

@jvigliotta jvigliotta enabled auto-merge (squash) March 23, 2022 22:33
@jvigliotta jvigliotta requested review from jvigliotta and removed request for jvigliotta March 23, 2022 22:34
Copy link
Contributor

@jvigliotta jvigliotta left a comment

Choose a reason for hiding this comment

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

LGTM!

@jvigliotta jvigliotta merged commit 0705d32 into master Mar 23, 2022
@trusktr trusktr deleted the dont-publish-test-files branch March 28, 2022 18:09
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.

[build] Invert npmignore file to reduce complexity
5 participants