-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Formalise CSV transition strategy #501
Comments
I do think we'd need some versioning here. The update scripts already check which version is currently running, and what version is required to update. Say the system is on 2.1.0 the user wants to upgrade to 2.3.0. The CSV file in 2.3.0 should contain:
The script parses the CSV file and should perform:
|
Taken from #426 (comment) : I can't think of any higher complexity (delete file x only if file y diesn't exist and z was created on christmas eve) demanding a more sophisticated format. Here are all examples I can think of:
General remarks:
One additional idea: A second parameter could contain either of |
Hey @BClark09, I agree we should include a versioning.
The list above doesn't contain an action to Modify/Update a file. @kaikreuzer suggested an APPEND action. My concern is, that this would only cover a small portion of intended use cases. A diff/patch file would be the better approach for general modifications but would also add unwanted complexity. Wdyt? |
INI files? INI files have sections and there are usually great tools/extensions for using them. I know it's an odd use of the format but it might fit nicely. |
INI creates the same issue. You have sections but only key=value pairs. |
When I was thinking csv, I was also thinking that whatever script could implement sections itself. In Pseudocode: currentVersion=getCurrentVersion()
if (firstParam == "[*]") then
if ( * < currentVersion ) then
skipToNextSection
end
end
Wouldn't downgrades work exactly in reverse? MOVE for example:
Fine until a DELETE action, because an UNDELETE would be impossible. |
Well no doubt that is possible! It's just not following the standard idea of CSV - which would be okay with me... |
Ah, I see. Quite honestly I didn't know there was a CSV standard as such. Every day is a school day! If we give it a file extension other than csv, this should be fine. ( |
I'm not seeing a situation in which this couldn't be used.
Each possible scenario has it's own section. Keys are simply TypeNumber and some sort of delimitation if needed. Is that not what @BClark09 is describing in the 2nd comment but without the impossible nested Sections? |
Whilst that would be a fairly simple strategy, what would you do if 2.3.0 was introduced and has the same structure as 2.2.0? Add one for each version anyway? In addition, The number of [From-To] you would need would be start becoming too large. For the number of versions openHAB may have (n), the number of sections would equal |
Yeah, it would be a vertically large file, whereas a .csv could be horizontally large. The two could be "combined" even more than I am suggesting like
Using the two delimiters could vertically simplify the file. I also use an .ini with 'nesting' much like .inf drivers do.
This could solve the same structure between versions. 2.2.0=2.2.0 and 2.3.0=2.2.0 as well. I'm not saying this is the best or better option. But I think it's a viable one to consider. |
Notes for what is necessary so far:
|
If I might add another feature to this: Would it be worth placing 'breaking change' messages in this file? For example
This way, the respective repos can use these messages to display important change logs. |
I like the idea! |
Me too! Should be very useful and could minimize the support threads and troubleshooting.... |
Alright! I've got the basics set up: With the following
And the shellscript in this gist. I get the following output: I realised that there should be a distinction between tasks that we want to execute before the main upgrade, and tasks we want to execute after the upgrade. Hence, the [[PRE]] and [[POST]] sections were necessary. Otherwise the script will run any command that is underneath a higher version than the current. For example, if the current version is 2.2.1, it will skip 2.2.0 and execute anything under 2.3.0. WDYT? |
We've been using these automated upgrades using the update.lst and some scripts on Linux and Windows for a while now. 👍 Do you think we can now close this issue? |
Sounds fair to me. |
Following on from #299
The majority of systems can now be upgraded in the basic sense, but we need to define a CSV format to tell the upgrade scripts what to do in special cases. The proposal in #299 was to read through a simple list of instructions e.g:
We should discuss the exact stategy here.
CC all who discussed this previously: @kaikreuzer, @mhilbush, @BClark09, @xsnrg, @whopperg, @ThomDietrich, @bdleedy, @ghys
The text was updated successfully, but these errors were encountered: