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

Manage Apalache server #1115

Merged
merged 15 commits into from
Aug 25, 2023
Merged

Manage Apalache server #1115

merged 15 commits into from
Aug 25, 2023

Conversation

thpani
Copy link
Contributor

@thpani thpani commented Aug 23, 2023

Manage Apalache server from Quint, as sketched in RFC 008.

I ended up reworking most of the retry logic for obtaining a gRPC connection, which blows up this PR a bit.

Closes #823

  • Tests added for any new code
  • Documentation added for any new functionality
  • Entries added to the respective CHANGELOG.md for any new functionality
  • Feature table on README.md updated for any listed functionality

@thpani thpani force-pushed the th/manage-shai branch 4 times, most recently from fd5ef83 to 23261e0 Compare August 23, 2023 16:32
Node.js 18 has been our required version since 9661448.

Fixes an issue with octokit not finding a global `fetch()`.
Copy link
Contributor

@shonfeder shonfeder left a comment

Choose a reason for hiding this comment

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

Great work, because everything works! I had a noodle around with some idioms trying to streamline the Either/async interactions, and the tar extraction.

Most of those suggestions are in the comments here, but I've also open a PR into this draft in case you want to see them all together or merge them in: #1116

quint/src/quintVerifier.ts Outdated Show resolved Hide resolved
Comment on lines 417 to 419
// Connection or pinging failed, download Apalache
console.log("Couldn't connect to Apalache, downloading latest supported release")
const distDir = await fetchApalache()
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean we will hit the github API everytime we need to start shai?

Could we do something like

  • Check if there a correct minor version installed in the quint assets, and if so, just start that.
  • If it's not there, then query for the versions etc.

Then we could have an update command to update apalache maybe? Or check a timestamp on the dir to see if it past some time frame and prompt for an update?

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this mean we will hit the github API everytime we need to start shai?

Yes. Could you articulate what issue you see with that?
It takes an average of 360ms on my machine.

We already have a pathway for performance junkies, which is to launch Shai separately.
So what you suggest may be an incremental improvement, but I'm hesitant to include it as long as we don't know if it's necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Beyond micro improvements, I have the aesthetic preference of not wanting my CLI tools to depend on hitting external APIs everytime I invoke them, esp when. it'll almost always be a wasted call.

But this also isn't a sticking point for me. We can always follow up here with incremental improvements in behavior and perf.

quint/package.json Outdated Show resolved Hide resolved
quint/src/quintVerifier.ts Outdated Show resolved Hide resolved
quint/src/quintVerifier.ts Outdated Show resolved Hide resolved
quint/src/quintVerifier.ts Outdated Show resolved Hide resolved
quint/src/quintVerifier.ts Outdated Show resolved Hide resolved
quint/src/quintVerifier.ts Show resolved Hide resolved
quint/src/quintVerifier.ts Show resolved Hide resolved
@shonfeder shonfeder mentioned this pull request Aug 24, 2023
4 tasks
Co-authored-by: Shon Feder <[email protected]>
Co-authored-by: Shon Feder <[email protected]>
@thpani thpani force-pushed the th/manage-shai branch 2 times, most recently from 3377f23 to f9dd4f4 Compare August 24, 2023 15:38
@thpani thpani changed the title [WIP] Manage Apalache server Manage Apalache server Aug 24, 2023
@thpani thpani marked this pull request as ready for review August 24, 2023 15:54
@thpani thpani requested a review from shonfeder August 24, 2023 15:54
Copy link
Contributor

@shonfeder shonfeder left a comment

Choose a reason for hiding this comment

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

Looks great! Just one Q. and a suggestion in the deps.

Comment on lines 10 to +15
### Added
### Changed

- The `verify` command now manages Apalache server, if no already running
instance is detected (#1115)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a feature add, not a breaking change, iiuc?

Suggested change
### Added
### Changed
- The `verify` command now manages Apalache server, if no already running
instance is detected (#1115)
### Added
- The `verify` command now manages Apalache server, if no already running
instance is detected (#1115)
### Changed

Copy link
Contributor Author

@thpani thpani Aug 25, 2023

Choose a reason for hiding this comment

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

Do we use these categories in a way that diverges from https://keepachangelog.com/?
They simple state

Changed for changes in existing functionality.

Whether this is a new feature, or modification of an existing one is largely up to interpretation. I'd treat it as a changed feature, as it does not expose additional core functionality. Rather, it improves UX.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will merge this PR, since Igor wanted to send install instructions for the summer school.
LMK if I should follow up with an updated changelog.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah. I take "changes for existing functionality" to entail breaking changes. Otherwise, none of the categories entail breaking changes, and I also don't know how you can change existing functionality without that possibly breaking previous expectation about the API. That said, I can see how disagreement of the interpretation here is possible.

Apparently there has been a long-onging debate about this, lol: olivierlacan/keep-a-changelog#41

Perhaps we should add a "Breaking changes" section?

I don't think my view is not widely enough shared to require any change to your entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see – yeah, it looks like the keepachangelog sections are a bit orthogonal to indicating breaking changes. Incidentally, also Removed may indicate a breaking change, so I guess in this taxonomy breaking changes are scattered across sections.

If we want to list breaking changes, we can either prefix individual items with a qualifier or break them into a separate section, as you suggested.

quint/package.json Outdated Show resolved Hide resolved
quint/package.json Outdated Show resolved Hide resolved
quint/src/quintVerifier.ts Show resolved Hide resolved
quint/src/quintVerifier.ts Outdated Show resolved Hide resolved
quint/src/quintVerifier.ts Outdated Show resolved Hide resolved
@thpani thpani merged commit fbda4d5 into main Aug 25, 2023
15 checks passed
@thpani thpani deleted the th/manage-shai branch August 25, 2023 09:34
@shonfeder shonfeder mentioned this pull request Aug 25, 2023
1 task
@bugarela bugarela mentioned this pull request Aug 25, 2023
@shonfeder shonfeder mentioned this pull request Aug 25, 2023
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.

Manage Apalache server
3 participants