Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
finalize_update -- why touch the assets?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Trupiano  
View profile  
 More options Jun 5 2008, 3:20 pm
From: John Trupiano <jtrupi...@gmail.com>
Date: Thu, 5 Jun 2008 12:20:33 -0700 (PDT)
Local: Thurs, Jun 5 2008 3:20 pm
Subject: finalize_update -- why touch the assets?
Hey Jamis,

I can't understand why we need to touch all of the asset files after a
re-deploy.  If I understand it correctly, rails uses the last modified
date on an asset to append the querystring value.  As such, this last
access date would change if a file was changed, but would otherwise
remain the same.  What then is the need to go ahead and dirty all of
the assets?

It seems to me that we're unnecessarily asking clients to re-download
all of our assets, even those that haven't changed.  Am I missing
something here?

Thanks.

-John


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jamis Buck  
View profile  
 More options Jun 5 2008, 3:22 pm
From: Jamis Buck <ja...@37signals.com>
Date: Thu, 05 Jun 2008 13:22:39 -0600
Local: Thurs, Jun 5 2008 3:22 pm
Subject: Re: [Capistrano] finalize_update -- why touch the assets?
It is so that the timestamps are all the same, across all of your
servers. If the timestamps are even a second off (which can easily
happen when you are deploying to multiple servers), then the client will
 have to download the assets again every time their request hits a
different server, which totally defeats the purpose.

- Jamis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Trupiano  
View profile  
 More options Jun 5 2008, 3:24 pm
From: John Trupiano <jtrupi...@gmail.com>
Date: Thu, 5 Jun 2008 12:24:50 -0700 (PDT)
Local: Thurs, Jun 5 2008 3:24 pm
Subject: Re: finalize_update -- why touch the assets?
Makes sense-- thanks.

-John

On Jun 5, 3:22 pm, Jamis Buck <ja...@37signals.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Trupiano  
View profile  
 More options Jun 5 2008, 5:30 pm
From: John Trupiano <jtrupi...@gmail.com>
Date: Thu, 5 Jun 2008 14:30:09 -0700 (PDT)
Local: Thurs, Jun 5 2008 5:30 pm
Subject: Re: finalize_update -- why touch the assets?
Actually, I'm still a little confused by this.  Doesn't your SCM
dictate the last accessed timestamp?  In other words, if your app is
checked out to several different app servers, shouldn't the timestamps
all come from the same authoritative source (the SCM)?

Am I (a) misinterpreting which file attribute is used by rails to
create the querystring param, or (b) misunderstanding how the last
modified timestamp is determined when checking code out of a
repository?

-John

On Jun 5, 3:24 pm, John Trupiano <jtrupi...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jamis Buck  
View profile  
 More options Jun 5 2008, 5:56 pm
From: Jamis Buck <ja...@37signals.com>
Date: Thu, 05 Jun 2008 15:56:02 -0600
Local: Thurs, Jun 5 2008 5:56 pm
Subject: Re: [Capistrano] Re: finalize_update -- why touch the assets?
I've not seen an SCM that preserves timestamps on checkout, but that
might just mean I'm doing it wrong. In practice, though, we (at
37signals) are seeing files being stamped with the time of checkout, not
with the time of last commit. This means that when checking out files on
multiple servers, if one server takes a little longer to comply with the
checkout request, the timestamps are off.

Now, if this is me doing something stupid, please correct me. I
certainly don't claim to be an expert in these matters. But the mass
touch of asset files on deploy was how we worked around it. I certainly
would be the last to complain if someone found a better way. That touch
command drives me nuts.

- Jamis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Masover  
View profile  
 More options Jun 6 2008, 6:00 pm
From: "David Masover" <d...@3mix.com>
Date: Fri, 6 Jun 2008 17:00:37 -0500
Local: Fri, Jun 6 2008 6:00 pm
Subject: Re: [Capistrano] Re: finalize_update -- why touch the assets?

Clients should be using ETags anyway...

That said, even if an SCM doesn't preserve timestamps, it should at least be
able to tell you when a particular file was last modified, and which files
have been modified since a particular revision. It'd still involve a touch,
but it'd be more accurate -- only changed files would appear as changed,
which is what you want.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Trupiano  
View profile  
 More options Jun 7 2008, 12:14 pm
From: John Trupiano <jtrupi...@gmail.com>
Date: Sat, 7 Jun 2008 09:14:16 -0700 (PDT)
Local: Sat, Jun 7 2008 12:14 pm
Subject: Re: finalize_update -- why touch the assets?
Looking into Subversion specifically, it definitely behaves as you
described Jamis.  An interesting idea would be to write a post-commit
hook that added a last-edited timestamp as a property on the file.
This would allow us to avoid this.

That said, that solution targets a specific SCM, and for it to work
with Capistrano, you'd need this subversion post-commit script.

What's terribly annoying about this is that Subversion does in fact
record the last modified timestamp.  Running svn info on a file will
give this information back to you.  I think it's ridiculous that
export and checkout don't allow the option to preserve this timestamp.

-John

On Jun 6, 6:00 pm, "David Masover" <d...@3mix.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Trupiano  
View profile  
 More options Jun 7 2008, 12:38 pm
From: John Trupiano <jtrupi...@gmail.com>
Date: Sat, 7 Jun 2008 09:38:27 -0700 (PDT)
Local: Sat, Jun 7 2008 12:38 pm
Subject: Re: finalize_update -- why touch the assets?
Ah ha!  Found it in Subversion.  There is a global configuration
option use-commit-times that by default is turned off.  This is a per-
host setting (and can be overridden by local user preferences) so this
means that it would part of your initial server setup.  In other
words, after installing Subversion, you would set this global config
parameter.

=========================
From the SVN manual:
=========================
use-commit-times

    Normally your working copy files have timestamps that reflect the
last time they were touched by any process, whether that be your own
editor or by some svn subcommand. This is generally convenient for
people developing software, because build systems often look at
timestamps as a way of deciding which files need to be recompiled.

    In other situations, however, it's sometimes nice for the working
copy files to have timestamps that reflect the last time they were
changed in the repository. The svn export command always places these
“last-commit timestamps” on trees that it produces. By setting this
config variable to yes, the svn checkout, svn update, svn switch, and
svn revert commands will also set last-commit timestamps on files that
they touch.

=========================

Capistrano could now expose another property to set...something like
'dont_touch_assets' (probably a better name).  The onus would be on
the app writer to know that he has set up his server's subversion
configuration to do just this.  Then, in finalize_update, this
property could be queried, and the touch process could be conditional.

Any interest in a patch?  Also, any suggestions on a good name for the
property?

-John

On Jun 7, 12:14 pm, John Trupiano <jtrupi...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jamis Buck  
View profile  
 More options Jun 7 2008, 2:08 pm
From: Jamis Buck <ja...@37signals.com>
Date: Sat, 07 Jun 2008 12:08:25 -0600
Local: Sat, Jun 7 2008 2:08 pm
Subject: Re: [Capistrano] Re: finalize_update -- why touch the assets?
Good find. I'm not opposed to another variable; there's already one for
determining whether or not to make the checkout group-writable. I'd
rather see the variable phrased as a positive, than a negative,
something like "normalize_asset_timestamps" and have it default to true,
much in the same way that "group_writable" is used.

- Jamis


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Trupiano  
View profile  
 More options Jun 7 2008, 3:35 pm
From: John Trupiano <jtrupi...@gmail.com>
Date: Sat, 7 Jun 2008 12:35:35 -0700 (PDT)
Local: Sat, Jun 7 2008 3:35 pm
Subject: Re: finalize_update -- why touch the assets?
I sent you a pull request on github for this-- I'm still getting my
feet wet with git, so let me know if I did something wrong.

-John

On Jun 7, 2:08 pm, Jamis Buck <ja...@37signals.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »