Safe to pull from Master?

Development-related discussion, including bundled plugins
justauser
Bear Rating Master
Bear Rating Master
Posts: 133
Joined: 23 Mar 2013, 20:37

Safe to pull from Master?

Postby justauser » 01 Apr 2013, 23:32

You're making a lot of interesting changes. I am wondering if it is safe for us to grab the latest version of master and use? How would we know if there is a database change, which I assume is the biggest risk on an update.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Safe to pull from Master?

Postby fox » 01 Apr 2013, 23:58

It's normally safe to use trunk. I use it so it's rarely broken. As far as I'm concerned everyone who can should use trunk, because this means more people checking stuff out and reporting bugs before release.

>How would we know if there is a database change

It'll prompt you.

troyengel
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 23 Mar 2013, 19:39

Re: Safe to pull from Master?

Postby troyengel » 02 Apr 2013, 19:12

Thanks for the prompting. :) I just converted from 1.7.5 to git/master -- part of that was to diff my config.php and I deleted SESSION_EXPIRE_TIME from it since it's now gone from config.php-dist. When I first hit the URL I received:

Code: Select all

Required configuration file parameter SESSION_EXPIRE_TIME is not defined in config.php. You might need to copy it from config.php-dist.
SESSION_EXPIRE_TIME set in config.php is too low, please set it to an integer value >= 60
SESSION_EXPIRE_TIME set in config.php should be >= to SESSION_COOKIE_LIFETIME


I dropped it back in my config.php, logged in and the DB upgrade prompted and worked without any issues at all, thx! One thought - maybe we could somehow define on the login page (index.php) that if it detects a .git/.gitignore in the same directory that you add to the version "-git" ? I whipped this up right quick, seems to work:

Code: Select all

--- include/login_form.php.orig   2013-04-02 14:40:05.000000000 +0000
+++ include/login_form.php   2013-04-02 15:11:45.000000000 +0000
@@ -246,9 +246,14 @@
 
 <div class='footer'>
    <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
-   <?php if (!defined('HIDE_VERSION')) { ?>
-       v<?php echo VERSION ?>
-   <?php } ?>
+   <?php
+   if (!defined('HIDE_VERSION')) {
+      print("v".VERSION);
+      if (is_dir('.git')) {
+         print("-git");
+      }
+   }
+   ?>
    &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
 </div>

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Safe to pull from Master?

Postby fox » 02 Apr 2013, 19:23

I have no idea what you did exactly but that got dropped with all required checks. So either you are doing something very horrible with git or I'm missing something obvious.

if (is_dir('.git')) {
+ print("-git");
+ }


I don't even want to get into explaining why exactly this idea is completely pointless. Just imagine that you can in fact follow release tags using git which would make your version exactly the same as the one unpacked from the tarball.

troyengel
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 23 Mar 2013, 19:39

Re: Safe to pull from Master?

Postby troyengel » 03 Apr 2013, 00:44

fox wrote:I have no idea what you did exactly but that got dropped with all required checks. So either you are doing something very horrible with git or I'm missing something obvious.


I don't have a direct answer to that -- once the DB upgraded it started working fine, I could comment it back out. Cached javascript or whatnot in my browser? The only indication I got in the log was this line:

Code: Select all

[Tue Apr 02 14:53:32 2013] [error] [client 10.183.248.5] PHP Warning:  session_destroy(): Trying to destroy uninitialized session
in /var/www/html/include/functions.php on line 695, referer: https://mydomain.com/db-updater.php


I don't even want to get into explaining why exactly this idea is completely pointless. Just imagine that you can in fact follow release tags using git which would make your version exactly the same as the one unpacked from the tarball.


The implementation may have been shortsighted (I'm no git guru) but the idea holds water; here's a different implementation that actually looks at .git/HEAD and sees if you're on the master and cannot be branch/tag:

Code: Select all

--- include/login_form.php.orig   2013-04-02 14:40:05.000000000 +0000
+++ include/login_form.php   2013-04-02 20:40:53.000000000 +0000
@@ -246,9 +246,18 @@
 
 <div class='footer'>
    <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
-   <?php if (!defined('HIDE_VERSION')) { ?>
-       v<?php echo VERSION ?>
-   <?php } ?>
+   <?php
+   if (!defined('HIDE_VERSION')) {
+      print("v".VERSION);
+      $gitfile = $_SERVER['DOCUMENT_ROOT']."/.git/HEAD";
+      if (is_file($gitfile)) {
+         $gitrev = file_get_contents($gitfile);
+         if (($gitrev) && ($gitrev = "ref: refs/heads/master")) {
+            print("-master");
+         }
+      }
+   }
+   ?>
    &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
 </div>


Knowing that I'm running on an experimental branch I find to be useful. It would be even more useful if it somehow indicated the date/timestamp that I last did a git pull as well, but I'm not that git-friendly yet.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Safe to pull from Master?

Postby fox » 03 Apr 2013, 00:49

>I don't have a direct answer to that -- once the DB upgraded it started working fine,

What's strange is that the check you quoted has absolutely nothing whatsoever to do with the database. It should have been removed from sanity_config.php etc with the template constant. Well, let's file it as works now / who cares.

>Knowing that I'm running on an experimental branch I find to be useful.

There's nothing experimental about master. Stuff that is seriously breaking I usually do in private branches / test instances and merge (or not) later. Master should stay usable because I and a few friends read RSS feeds on it.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 3 guests