how to deploy a corrected library - google-apps-script

I find a bug in a library (release 8) already used by many scripts.
I want these scripts to used the corrected library, but I can't change the library release number in each script.
I'd like replace the code in release 8 by the new code, with the same release number.
Is'it possible ?
Thanks

Related

Can mt.xe update a manifest embedded in middle (not near the end) of an exe?

I'm trying to update the manifest included in a Visual FoxPro app with some registry free COM entries. A compiled FoxPro exe appears to contain a VFP runtime along with with some string resources and a default manifest, as well as the pre-compiled app code appended to the end of the exe. When using mt.exe -manifest app.manifest -outputresource:app.exe;#1 the resulting exe is truncated. The manifest is placed at the end of the exe and all the pre-compiled app code is simply removed. Is there a way to update the embedded manifest using mt.exe without removing the app code from the exe, which is normally appended after the manifest?
I've found two alternatives that do NOT work for me. I'm forced to compile the exe with VFP 8, due to code incompatibility with VFP 9.
An article written by Rick Strahl https://www.west-wind.com/wconnect/weblog/ShowEntry.blog?id=890 that assumes the app is compiled using FoxPro 9 SP 2, which isn't an option for me.
A project hook class that assumes the app is compiled in VFP 9 https://www.sweetpotatosoftware.com/blog/index.php/2009/08/03/apply-application-manifest-at-compile-time-with-projecthook/ This is kind of close, but compiling with VFP 9 is not an option for me.
I'm hoping mt.exe provides a better alternative than building my own app to update the manifest in a VFP 8 exe.

Library with identifier underscoreGS is missing

I was using underscoreGS for a long time, but I got "Library with identifier underscoreGS is missing (perhaps it was deleted, or you don't have read access?)" this error suddenly.
underscoreGS should be a public lib, I should be able to access it. I also try to delete and add this to the project again, I can re-add it, but the error still there.
This is my code
if (tmpDate.getTime() == tomorrow.getTime() && underscoreGS._indexOf(added, row[1], false) < 0){
Does anyone have the same problem? Or underscoreGS having a problem?
I can reproduce this behaviour. It looks like this behaviour is not limited to underscoreGS, but others like GSUnit and YouTubeApp result in the same error message.
I'd say it's possible that the owner of these libraries has changed the sharing settings and these libraries might no longer be public.
This has been reported in Issue Tracker:
Issues with underscoreGS, GSUnit libraries, and others?
Error replacing library
Update 2020-01-21:
One of these issues was updated with the following comment from Google:
This is not an issue with library import, this is a configuration problem by the library host/owner.
Please take this up with the third party developers of the affected libraries.
So apparently, this is not an issue with the library import process, but with the libraries themselves. Since these libraries are not officially supported by Google, anyone affected by this should take this up with the library developers.
Also, another developer shared backup scripts for these libraries in this comment, as mentioned in Gonzalo's answer.
Reference:
GAS Library Management (public)
Provisional Solution
From a comment on the same issue tracker mentioned by #Iamblichus
I don't know if the libraries can be brought back online. In the meantime, here are backups:
ObjApp source code:
https://script.google.com/d/1fCGHsA4zJ3ow0U_LFJclWTP8ctgDuMCZIrQ0bFCchSAIpnjNbWrW_Vre/edit?usp=drive_web
Script ID (to use as library):
1fCGHsA4zJ3ow0U_LFJclWTP8ctgDuMCZIrQ0bFCchSAIpnjNbWrW_Vre
GSUnit source code:
https://script.google.com/macros/d/1T4ao_R66gK5hK4dtKHT4p7kractojP2tYau9dOzcG7xJrYyl_gWiQ7a_/edit?usp=drive_web
Script ID (to use as library):
1T4ao_R66gK5hK4dtKHT4p7kractojP2tYau9dOzcG7xJrYyl_gWiQ7a_
underscoreGS source code:
https://script.google.com/d/1mBlMu5QzQSO0X3pGZHPBPfLYh5UuSRLETBb9x-EIyOzMPrd0SA-i7QdR/edit?usp=drive_web
Script ID (to use as library):
1mBlMu5QzQSO0X3pGZHPBPfLYh5UuSRLETBb9x-EIyOzMPrd0SA-i7QdR
Reference:
Issues with underscoreGS, GSUnit libraries, and others?
This is happening to me aswell just since yesterday for the ObjApp library but intermittently which makes me believe it is on Googles end

Why can't I import a Library in Google Scripts editor?

I've recently created a Google Scripts new Project, called Database. Then, I've used a saved version (version 4) of that script in another project and afterwards dropped (by accident) that version of Database. Now, even if a create a new version, when I open in the menu Resources > Libraries of nthe new project, the Database project appears with the version 4.
screen
When I try to change it and save, the following error appears:
A biblioteca com o identificador Database está ausente. Talvez tenha sido excluída.
(The library with the identifier Database is missing. Maybe it has been excluded).
What can I do now?
You may refer with this post: Library with identifier XXXXXXX is missing (perhaps it was deleted?).
According to the release notes for November 4 2013, a fix for sporadic missing library errors has been rolled out. (Refer to Issue 2817.)
At the same time, a change was introduced such that "If a version of a library has been deleted by the library owner, scripts can no longer use that version." Previously, a script could have been using version 3 of a library, say, even after that version had been deleted. Suddenly, around November 4, that script would have begun failing. The fix in this case is to update the resources used by the script to refer to a still-existing version of the library.
Also as stated in this thread, it seems that there is a problem where sometimes libraries get out of sync. You may need to create new versions for the libraries even though these are in development mode.

Always include the latest version of custom Google Drive library

I'm trying to link a custom library to a document that will be copied and shared with many people. I want to have all documents link to the latest version of the library, so when I modify the library I don't have to access all the documents to change the link.
This is the scenario:
I created a simple single function library (e.g. library TestLib, function foo()), and saved a first version of it. Then I've created a SpreadSheet with a script that generates a user menu that calls function TestLib.foo(). I've linked version 1 of the library to the script. Now I want to make several copies of the document, one for each people who will need it. The problem is that these documents are linked to version 1 of the library. If I made a change to the library and create a version 2, I have to manually re-link all documents to the new version. That's gonna be lot of work...
Is there a way to have the script to always link to the latest version?
NOTE: the library project is shared in read-only mode (people won't collaborate with the code. They just call foo() from the menu when needed).
Thank!
MIX
I made a new test, trying to overtake the version "limitation" problem.
The idea is a little complicated, but promising. The spreadsheet calls a function in library LinkLib: this library will be saved in a single version and the source code will never modified. The library function simply calls a function on another library (MainLib), whom source code can change over time. Spreadsheet doesn't need to change the version of the linked library (there will never be new version of BaseLib source code), while BaseLib can change the version of MainLib linked if I made changes in MainLib's source code..
The problem is: changing the version of a linked resource is treated as a source code modification. So you need to save a new version of BaseLib to actually use an updated version of MainLib's function.
Hope this mess is somewhat clear...
It makes sense that the described version management behave like this. But damn, I'm still stuck with this problem...
this is possible but with a risk. simply use "development mode" for all documents using the library. whenever you update the library it will include the new code automatically.
the risks are that you will have to be careful to never save an intermediate/partial change as all changes need to not break anything. this can be tricky and is best to have a separate library copy to use when making and testing changes. once tested you may copy all files and "save all" together so the script doesnt have partial saves.
basically you lose the development facilities of using versions.
read more about library development mode in the official docs.

Using unitils/dbMaintain to maintain database, how to exclude scripts from being run?

I am using unitils (and its dbMaintain module) to maintain the state of my local database.
dbMaintain has an option to exclude/include scripts based on a qualifier. See http://www.dbmaintain.org/tutorial.html#Qualifier_inclusion__exclusion.
In my project, excludes/includes do not work when running from a Unitils test with the UnitilsJUnit4TestClassRunner.
My script hierarchy:
unitils/
01_create/ <lots of scripts here>
02_lkups/ <lots of scripts here>
03_#testdata/01_#testdata_master/05_#testdata_master_rate_offer.sql
My unitils.properties file has:
updateDataBaseSchema.enabled=true
dbMaintainer.script.locations=unitils
dbMaintainer.qualifiers=testdata
dbMaintainer.excludedQualifiers=testdata
I would expect 05_#testdata_master_rate_offer.sql to be excluded. But it is being run.
Thanks in advance for any help.
Answered by one of the unitils developers on the unitils forums here: http://sourceforge.net/projects/unitils/forums/forum/570578/topic/4546980
Qualifiers are a feature of
dbmaintain. Unitils 3.1still contains
its own dbmaintainer which still dates
from before the split-off of
dbmaintain. Unitils 4.0 has this
module replaced by a dependency to
dbmaintain, but this version is not
released yet. I would suggest that,
until 4.0 is released, you call
dbmaintain directly from your java
code. Hope this helps, Filip