HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


How to add new features not part of a release

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#84749 (In Topic #17469)
Avatar

Community saint

For new features like the Spammer database and the grid layout, you have provided both a .tar and a .patch file on the issue tracker. What is the best way to deploy these new features. It seems to me that using the .tar leaves you open for over-writing both your own changes plus changes from other .patch files. Thus, it seems like it would be safer to update using the .patch file which I will only write out the actual changes made. There is only one problem: how do I use this file? Do I ssh to my site directory and then execute this file in a terminal?

Any help is greatly appreciated.

Bob
Back to the top
 
Posted
Rating:
#84752
Avatar

Community saint

What I did when I deployed the grid layout for the jewelry site is extract all the .tar files manually and upload them to the relevant _custom folders.

I don't know if that is the right way or the best way but it worked well for me.
Back to the top
 
Posted
Rating:
#84755
Avatar

I need to be careful with how I respond here, as the quoted costs for the sponsorship covers the development, but not ongoing support for helping people use that patch across different versions – which could easily become a very substantial ongoing cost for us. Once the tar is built that's where we need to draw the line on it, except of course if there's something we haven't initially done right (e.g. bugs). The primary aim is to get stuff staged for new versions – if people need something right away for themselves, feature sponsorship isn't necessarily the best avenue for it.

Regarding the tar and the patch…

The tar is there for ease of use.

The patch is there because, if you know how to apply it, and resolve conflicts, it allows theoretical application against future versions, not just the current one for when the sponsorship was finished. Here is how to apply a patch:
How to apply `git diff` patch? - Stack Overflow
There's a lot out there about patches. But application can and does fail sometimes, because code lines shift around over time.

So I would suggest just using the tar if possible. The potential problems I see are:
  1. If files are updated in the tar that are also overwritten by other sponsored features
  2. If files are updated in the tar that are also overwritten by changes in new versions
  3. The sponsored feature can't necessarily be guaranteed to fit into any upgrade path. Things could shift all over the place between versions (e.g. database structure), and any particular extra injected code is not going to necessarily fit neatly into that.

There's not a whole lot we can do about it. It would be unworkable to tie the sponsorship to release schedules – and the cost just funds work for hire at a point of time. So I can only really say the following:
  • Only apply sponsored features you really do need.
  • Otherwise wait until the release that introduces them (although I can't say anything about when they would be, at least not at the moment).
  • If something goes wrong, take out some support to get the problem fixed. Chances are resolving conflicts aren't going to take us hours.
  • For problem '2' above, it's probably not the end of the world. We put v8 through a long RC period, so any bugs found in the future are unlikely to be important and it's unlikely going to be a problem if you re-extract the sponsored feature tar after doing an upgrade. We are also very unlikely to do any major code restructurings to disrupt how code files might fit together.
  • Regarding problem '1' above. In most cases, sponsored features won't result in the same files being overwritten, so the long discussion here is overstating the problem somewhat.

As I said in my first line, I am carefully wording my response. It's very important small bits of funded development, paying for a few hours of salary, don't lead to ongoing multi-month commitments to ongoing support and maintenance. But, at the same time we're usually pretty reasonable and if some breakage happens and we can put a quick solution out, we usually do.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#84756
Avatar

Community saint

Brian Hay said

What I did when I deployed the grid layout for the jewelry site is extract all the .tar files manually and upload them to the relevant _custom folders.

I don't know if that is the right way or the best way but it worked well for me.

That's what I did when I first tested it with one of the RCs. I am just wondering if there is a better way which feeds the changes into the main code such that it will be automatically overwritten at the next upgrade. I really like to keep things as streamlines as possible.

I know that I should, in theory, be able to use the patch file to apply the changes without any fear of overwriting other stuff. For instance, when the dynamic selection/filtering is released, I suspect that it will touch some of the same files. In this case, it would be important to know precedence, I think.

Anyway, Chris has weighed in with an answer so I will see what he has to say and perhaps what others like temp1024 would do.

Bob
Back to the top
 
Posted
Rating:
#84757
Avatar

If you are wanting them as overrides, I wouldn't – instead I'd simply make a list of things to do after upgrading, and include "extract xxx tar" as a part of that list (keep them in the same folder on your computer perhaps).

Never underestimate a good old list ;).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#84759
Avatar

Community saint

Chris Graham said

I need to be careful with how I respond here, as the quoted costs for the sponsorship covers the development, but not ongoing support for helping people use that patch across different versions – which could easily become a very substantial ongoing cost for us. Once the tar is built that's where we need to draw the line on it, except of course if there's something we haven't initially done right (e.g. bugs). The primary aim is to get stuff staged for new versions – if people need something right away for themselves, feature sponsorship isn't necessarily the best avenue for it.

Regarding the tar and the patch…

The tar is there for ease of use.

The patch is there because, if you know how to apply it, and resolve conflicts, it allows theoretical application against future versions, not just the current one for when the sponsorship was finished. Here is how to apply a patch:
How to apply `git diff` patch? - Stack Overflow
There's a lot out there about patches. But application can and does fail sometimes, because code lines shift around over time.

So I would suggest just using the tar if possible. The potential problems I see are:
  1. If files are updated in the tar that are also overwritten by other sponsored features
  2. If files are updated in the tar that are also overwritten by changes in new versions
  3. The sponsored feature can't necessarily be guaranteed to fit into any upgrade path. Things could shift all over the place between versions (e.g. database structure), and any particular extra injected code is not going to necessarily fit neatly into that.

There's not a whole lot we can do about it. It would be unworkable to tie the sponsorship to release schedules – and the cost just funds work for hire at a point of time. So I can only really say the following:
  • Only apply sponsored features you really do need.
  • Otherwise wait until the release that introduces them (although I can't say anything about when they would be, at least not at the moment).
  • If something goes wrong, take out some support to get the problem fixed. Chances are resolving conflicts aren't going to take us hours.
  • For problem '2' above, it's probably not the end of the world. We put v8 through a long RC period, so any bugs found in the future are unlikely to be important and it's unlikely going to be a problem if you re-extract the sponsored feature tar after doing an upgrade. We are also very unlikely to do any major code restructurings to disrupt how code files might fit together.
  • Regarding problem '1' above. In most cases, sponsored features won't result in the same files being overwritten, so the long discussion here is overstating the problem somewhat.

As I said in my first line, I am carefully wording my response. It's very important small bits of funded development, paying for a few hours of salary, don't lead to ongoing multi-month commitments to ongoing support and maintenance. But, at the same time we're usually pretty reasonable and if some breakage happens and we can put a quick solution out, we usually do.

Chris-

Thanks for this. I don't expect you to provide ongoing support, especially with all you already do to provide great updates at a very reasonable price.

I know I previously used a DIFF tool (Beyond Compare on Windows) that would take a patch file and apply the changes. This always worked really well since my code is almost always close to the released. I was checking what theming work needs to be done and I was surprised that I have only 9 over-ridden templates. Most all the CSS is over-ridden but that is most often only dealing with color changes.

I guess I am somewhat lazy when it comes to this mostly because I just have so much research material to wade through and then all the writing that is involved.

Anyway, I appreciate the link the git diff patch instructions. I'll most likely just upload the files from the tar for this release but I may use the patch method for future upgrades that touch a lot of the same code.

Bob
Back to the top
 
Posted
Item has a rating of 5 (Liked by Jean)  
Rating:
#84782
Avatar

Community saint

Chris Graham said

… wait until the release that introduces them (although I can't say anything about when they would be, at least not at the moment).
That's my cunning plan, Baldrick!

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#84791
Avatar

Community saint

BobS said

Anyway, Chris has weighed in with an answer so I will see what he has to say and perhaps what others like temp1024 would do.
It really depend on nature of the change and how extensively it integrates into existing files. I'd most likely use the patch. And down the track if I find that patch was failing too much with later versions of ocportal I'd consider re-doing the patch to give it a new lease on life.

As for lists, they are probably a must, if nothing else it provides a check-list for things to check after the upgrade.

I've been really slack with lists myself for my customisations. Although I do have a list, its nowhere near as complete as it should be, but at least its a start.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#84816
Avatar

Community saint

temp1024 said

It really depend on nature of the change and how extensively it integrates into existing files. I'd most likely use the patch. And down the track if I find that patch was failing too much with later versions of ocportal I'd consider re-doing the patch to give it a new lease on life.

As for lists, they are probably a must, if nothing else it provides a check-list for things to check after the upgrade.

I've been really slack with lists myself for my customisations. Although I do have a list, its nowhere near as complete as it should be, but at least its a start.
I need to do better with keeping lists. I am pretty good about always notating any changes I've made in a file making it easier to search them down.

I am really fascinated with the possibility of using the patch files to update as this seems it would be a real convenience and time-saver. Of course, as Chris points out, that advantage could disappear rather quickly if you have several patches touching the same file thus moving line numbers around.

I will, no doubt, be back asking for pointers with this once I work up the nerve to try it.

Bob
Back to the top
 
Posted
Rating:
#84842
Avatar

Community saint

BobS said

Of course, as Chris points out, that advantage could disappear rather quickly if you have several patches touching the same file thus moving line numbers around.
It also could be the changes in the lines themselves, but that is far less likely. In any case, if it get too bad you could create a fresh patch.
I will, no doubt, be back asking for pointers with this once I work up the nerve to try it.
I haven't used this specific patch method before, but don't let that stop you from asking questions.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#84846
Avatar

Community saint

temp1024 said

BobS said

I will, no doubt, be back asking for pointers with this once I work up the nerve to try it.
I haven't used this specific patch method before, but don't let that stop you from asking questions.
Thanks, temp.

I'm going to get some of the v8 features working first before I attempt on adding any of the subsequent feature releases. But I will be back with questions.

Bob
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: