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

pkg: drop "version" from manifests #15396

Conversation

allisonkarlitskaya
Copy link
Member

@allisonkarlitskaya allisonkarlitskaya commented Feb 22, 2021

This field was introduced in #4964 as "purely informational for now",
and isn't even parsed by cockpit. Meanwhile, it's one of the few things
preventing us from untangling our webpack build from autotools.

Even within cockpit, usage is inconsistent: most packages set "version"
to the string that @Version@ expands to, but machines had it set to the
integer 0, and pcp and static had no "version" field at all.

It seems nobody is going to miss this. Just drop it.

The one place which did reference this was a test which directly read
the manifest.json.in file from the playground and does a direct
comparison on it. That's been adjusted accordingly now.

@martinpitt
Copy link
Member

Several failures, moving to draft. I also fixed the PR description.

@martinpitt martinpitt marked this pull request as draft February 23, 2021 08:56
@martinpitt
Copy link
Member

The tests work again when I just revert pkg/base1/manifest.json.in , i.e. put back VERSION there. That seems to be the only relevant one. I can't immediately pinpoint code that would read it, though.

@martinpitt
Copy link
Member

login page's machine_application_login_reload() looks at the base1 manifest version. This is ancient code which we really don't need any more. I removed that code locally and at least the handful of tests that I ran locally work fine now.

@martinpitt
Copy link
Member

With this patch most of the failing tests should work again, but locally I still get a failure with test/verify/check-superuser TestSuperuserOldWebserver.test. But, incremental improvement..

@martinpitt
Copy link
Member

Force-pushed to include that commit, let's see what's left now. In the worst case, we just keep the version in base1 and teach make dist about substituting it?

@martinpitt
Copy link
Member

martinpitt commented Feb 24, 2021

I split out dropping the compat code to #15423 to get it tested separately.

Update: That is all green, and works.

@martinpitt
Copy link
Member

Looking at the TestSuperuserOldWebserver.test failure, some notes.

  • With a sit() at the top of the test and hacking version 238 back into /usr/share/cockpit/base1/manifest.json, the test works, so it's definitively a base1 version check.
  • Setting version: 100 makes it fail, so it's not just about the field being present, the version matters.
  • PR sudo: Rework it for the local machine  #13482 introduced this check, but neither contains a relevant reference to "base1" nor to "version".
  • Commit 84b6195 seems to not use a version number, but the plain1 vs. superuser messages in the bridge init.

@mvollmer, do you know something off the top of your head what could require the bridge manifest's version here?

@martinpitt
Copy link
Member

This reproduces interactively. Clicking the menu on the remote machine on http://127.0.0.2:9091/cockpit+=10.111.113.2/@localhost/shell/index.html most often does not do anything; on some pages it works, but it always takes two or five clicks to eventually succeed. Also, the URL does not change at all.

My theory is that this is somehow related to 4511d83 -- while the new (remote) bridge does not have that any more, the old centos-7 bridge certainly would.

As such it seems to me that we'd first need to drop that backwards compat code from all the old bridges which are around, which given RHEL 7 will still be a while.

My proposal: Put back a static "version: "219" field into base1/manifest.json, but stop treating it as a package version, and consider it a legacy "API version" field for older releases, until RHEL/CentOS 7 go EOL. "219" because that's when the behaviour was last modified in PR #13482.

@allisonkarlitskaya , @mvollmer , WDYT?

@mvollmer
Copy link
Member

WDYT?

I can't say anything about this, unfortunately. Putting a static version just into base1/manifest certainly looks reasonable.

This field was introduced in cockpit-project#4964 as "purely informational for now",
and isn't even parsed by cockpit.  Meanwhile, it's one of the few things
preventing us from untangling our webpack build from autotools.

Even within cockpit, usage is inconsistent: most packages set "version"
to the string that @Version@ expands to, but machines had it set to the
integer 0, and pcp and static had no "version" field at all.

There are only two places where this was being used:

 - Login pages before commit 4511d83 check the remote base1
   manifest version to decide if it supports remote URLs. This version
   is still supported for a few years in RHEL/CentOS 7, so for now we
   can't remove base1's version field. But this only functions as an
   "API compatibility level" field: it does not need to accurately
   follow the release numbers, it just needs to be bumped on
   incompatible changes. The last one was the sudo authentication rework
   in PR cockpit-project#13482 in version 219, so set version to that and add a
   `version-note:` field (in lieu of a comment) that explains the
   number.

 - The base1/test-http.js unit test: this directly reads
   the manifest.json.in file from the playground and does a direct
   comparison on it.  That's been adjusted accordingly.

Thus, drop all version fields except base1's.
@martinpitt
Copy link
Member

Done, with this it ought to succeed now. Marking as ready for review. @mvollmer, want to give it a final review, as both Lis and I touched this now?

@martinpitt martinpitt marked this pull request as ready for review February 25, 2021 13:08
@martinpitt
Copy link
Member

@martinpitt
Copy link
Member

martinpitt commented Feb 26, 2021

This is about as green as tests can get right now, this looks good to land. @mvollmer, can you please review?

@allisonkarlitskaya allisonkarlitskaya merged commit 6bc6f39 into cockpit-project:master Mar 1, 2021
@allisonkarlitskaya allisonkarlitskaya deleted the remove-manifest-version branch March 1, 2021 09:29
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.

None yet

3 participants