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

[pulsar-updater] Don't notify if Pulsar is running via yarn start #679

Merged
merged 3 commits into from
Aug 22, 2023

Conversation

confused-Techie
Copy link
Member

When a developer of Pulsar is running Pulsar locally, such as using yarn start the version of Pulsar would be reported as ending with -dev, which according to semver is a prerelease channel and would always be lower than the same version without the -dev.

For example:

  • We have just published 1.108.0.
  • A developer then starts working on Pulsar with the version of 1.108.0-dev
  • pulsar-updater sees 1.108.0-dev and uses semver to compare it to the latest GitHub release of 1.108.0
  • Then semver sees the prerelease and assumes it's out of date compared to GitHub
  • pulsar-updater prompts for an Update

What this means, is that almost always when a developer is working on Pulsar they will be notified to update via pulsar-updater.

This PR includes a manual check within pulsar-updater to see if atom.getVersion() ends with -dev and if so will not emit a notification for an update.

@confused-Techie confused-Techie merged commit 40a2c3f into master Aug 22, 2023
@confused-Techie confused-Techie deleted the pulsar-updater/fix-yarn-start branch August 22, 2023 23:44
@DeeDeeG
Copy link
Member

DeeDeeG commented Aug 25, 2023

Belated approve+ from me.

I'm not familiar with pulsar-updater's internals, but the changes look reasonable to me, and looks like it should do what the PR description says.

Which is a good thing to do -- less notification spam!

Thanks for this, this updater has seen a lot of feedback on the Discord and a lot of that feedback has been implemented. Thanks for the feature and continuing to refine it, very cool!

@confused-Techie
Copy link
Member Author

Appreciate you @DeeDeeG

Comment on lines -8 to 10
it("Returns spec mode if applicable", async () => {
it("Returns developer instance if applicable", async () => {
// We can't mock the atom api return from a package,
// So we will just know that if tests are running, it's in the Atom SpecMode
Copy link
Member

Choose a reason for hiding this comment

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

It's a little late, and I'm just now seeing this, but if it's important for this test to really check for "spec mode," that return value is now hidden behind the "dev mode" thing, due to the circumstantial fact that CI builds a version ending with -dev, and the -dev check presumably returns earlier than the "spec mode" check happens in the app code...

So IMO this test either needs the comment updated to explain that this is looking at whether the app has a -dev version string, or else the scenario is not useful at what the comment says it is checking and should be "fixed" to actually detect "dev mode" in our CI setup, or removed (but probably not removed, it's still checking something useful, IMO.)

Maybe off-topic aside note (click to expand):

(Aside: and I suppose there are a tiny few things elsewhere around the app that change with the version string ending in -dev, so you really can call it "dev mode". It's not strictly just that the version ends with -dev... So. That said, Regular releases can activate dev mode if they want, I dunno if I'm just off on an unrelated tangent here or what. Hm. Almost definitely overthinking it for this little comment that needs updating now that the meaning of the test has changed.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Really the important aspect was this test would check for however Pulsar runs while running tests.

Which prior to this addition of Developer Instance being added was spec mode since that's true, it just becomes also true that it's Developer Instance.

But as for you secondary tangent, don't worry, we also check for Developer Mode, which is when the editor is run in actual developer mode. I just thought Developer Instance could get the point across that it's a version of the editor literally being run via yarn start.

Also I will say, that talking further on this has made me realize a potential issue we may encounter in the near future.

With these changes as is, this test will fail when we do a Regular Release PR. Since at that point the version will no longer end in -dev.

So it may be worth it to consider checking for spec mode first, and changing the test back, or otherwise finding a new solution.

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.

2 participants