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

Server version publication improvements #2838

Closed
wants to merge 2 commits into from
Closed

Conversation

lfield
Copy link
Contributor

@lfield lfield commented Nov 23, 2018

These improvements were the result of discussions with Einstein@home.

html/user/get_project_config.php Show resolved Hide resolved
if ( isset($server_version) && isset($git_commit) ) {
echo "Server version: $server_version (<a href=https://github.com/BOINC/boinc/commit/$git_commit>$git_commit</a>)<br>";
global $git_url;
if ( isset($server_version) && isset($git_url) ) {
Copy link
Contributor

@brevilo brevilo Nov 30, 2018

Choose a reason for hiding this comment

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

I recommend to make the link optional but always show the version (if available). Right now $git_url is set in a way that makes the following assumptions:

  • the source repo was cloned via https, not ssh
  • the source repo's relevant remote is called "origin"

I think that both assumptions shouldn't be made. At least the code should prepare for the case that they're no met, i.e. make the link/URL optional and don't just assume you got a "working" $git_url.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The release.inc file can always be edited/deleted.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the point of this PR if projects are meant to edit release.inc manually afterwards? What I'm trying to convey here is that the current implementation makes assumptions that won't always be met. Even worse, it doesn't handle gracefully the case when the assumptions aren't met, producing an invalid HTML link.

f.close()
os.chmod(os.path.join(dest_dir, 'release.inc'), 0o644)
'''.format(git_url=git_url, version=version)
f = open(os.path.join(dest_dir, 'release.inc'), 'w')
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this file only written once during the initial project instantiation? Shouldn't the version be a dynamic detail that always represents the current state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is also created when doing upgrade.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. That's ok as a start but I really think this should be dynamic. Since you're not using --abbrev=0 you show the number of commits since the tag and the local SHA1. This means you think these are interesting details. If, however, the version detail only gets updated with a formal server code update via the BOINC update script, you will miss any other change to the deployed codebase. I think this should be generated by a daily project task.

@lfield
Copy link
Contributor Author

lfield commented Dec 4, 2018

It has now been done a different way.

@lfield lfield closed this Dec 4, 2018
@JuhaSointusalo JuhaSointusalo deleted the lfield-version branch April 6, 2019 13:26
This pull request was closed.
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