go to post Timothy Leavitt · Apr 18 In your CSP page, when writing out the JS, you could do something like: write "var myObject = ",! do stream.OutputToDevice()
go to post Timothy Leavitt · Dec 4, 2024 I definitely haven't seen issues like this with Apache, and the trailing "///" in ^XVMC("base") is definitely suspicious. It's very possible that the "clever" approach of having a .csp page serve things under further URL segments doesn't work nicely on nginx.
go to post Timothy Leavitt · Nov 7, 2024 The two key methods here for output sanitization are: %CSP.Page:QuoteJS - for output sanitization targeting JavaScript string literals %CSP.Page:EscapeHTML - for output sanitization targeting HTML content
go to post Timothy Leavitt · Nov 6, 2024 Note, setting the /exportselectivity flag to 0 as a default may help with this - https://docs.intersystems.com/iris20242/csp/docbook/Doc.View.cls?KEY=RCO...
go to post Timothy Leavitt · Nov 4, 2024 @Jani Hurskainen providing a top-level answer here: If you want to truly build your own unit test framework from scratch, you'd need to create a custom resource processor class in IPM. I see from https://github.com/intersystems/ipm/issues/616 that you've already discovered this feature and I appreciate your tenacity and the deep dive into IPM that you're doing. Every development team I've worked on within InterSystems (that is, three very different ones) has had its own things it's wanted to do that %UnitTest.Manager and %UnitTest.TestCase don't *quite* do the way we want, with the API we want, right out of the box. The approach in general is to extend %UnitTest.Manager to tweak unit test runner behaviors (IPM does this itself, as you may have noticed); to extend %UnitTest.TestCase to add application-specific utility methods, assertions, and generic On(Before|After)(All|One)Test(s?) implementations (often controlled by class parameters); and potentially to add some mix-in utility classes that one might extend along with %UnitTest.TestCase or your own derived unit test base class. For the basic case of "I want to run tests with my own %UnitTest.Manager subclass" we have a flag you can pass in to override the unit test manager class, -DUnitTest.ManagerClass=yourclassname. See https://community.intersystems.com/post/unit-tests-and-test-coverage-int... for an example of how to use this (with my team's https://github.com/intersystems/TestCoverage open source package). At the IPM codebase level, there's special treatment of the common "pParams" array passed around everywhere - something looking at pParams("UnitTest","ManagerClass") will find the value specified in -DUnitTest.ManagerClass in the package manager shell command. Hopefully this is helpful!
go to post Timothy Leavitt · Oct 30, 2024 Confirmed - OCI/ORAS will be supported in the next major release after v0.9 and getting this wrapped up is our top priority.
go to post Timothy Leavitt · Oct 29, 2024 Sorted this out through a thread in a GitHub issue - https://github.com/intersystems/git-source-control/issues/597
go to post Timothy Leavitt · Oct 28, 2024 Perhaps the private webserver is running on 52773 inside the container and exposed as 52774 on the host? So from within the container you should connect to localhost:52773 instead of 52774.
go to post Timothy Leavitt · Aug 27, 2024 Hi @Jani Hurskainen - the short answer is "yes, TestCoverage is coupled to %UnitTest."Can you elaborate on what you have in mind by "other unit testing frameworks" and/or what you're trying to achieve? %UnitTest is the only unit testing framework for ObjectScript that I'm aware of. Is your objective to unify Python and ObjectScript unit tests?
go to post Timothy Leavitt · Jul 9, 2024 Hi @Kwabena Ayim-Aboagye - zpm "generate" will create module.xml in a folder on the IRIS server, and if you specify the folder that holds your code it should discover the things that are already in that folder and add them to module.xml.
go to post Timothy Leavitt · Apr 2, 2024 We'll be getting out the next release of git-source-control (https://github.com/intersystems/git-source-control) this month, which includes support back to 2016.2 via an artifact associated with (some) releases. We haven't produced this for the past few releases but will do so for the next one. You can follow the project here to be notified about new releases: https://openexchange.intersystems.com/package/Git-for-Shared-Development...
go to post Timothy Leavitt · Feb 1, 2024 For classes, see $System.OBJ.IsUpToDate() For routines, see the UpToDate property in an instance of %Library.RoutineMgr
go to post Timothy Leavitt · Jan 4, 2024 Assuming this is with git-source-control, the approach would be to have the temp folder *and all subfolders* owned by SYSTEM (in this case), as discussed at https://github.com/intersystems/git-source-control?tab=readme-ov-file#du.... This is under folder Properties > Security > Advanced. Click "Change" next to "Owner", and under Object Names to Select type in "SYSTEM". Before applying, check the box with "Replace all child object permission entries..." at the bottom of the dialog. That should do it.
go to post Timothy Leavitt · Jul 26, 2023 The web UI provides the option to stage and commit another user's changes (after confirming that yes, you really do mean to do so).
go to post Timothy Leavitt · Jul 26, 2023 I discussed this with Jason earlier this week. The simplest solution is to use the InterSystems Package Manager (IPM) with a local development environment model - if you have multiple local repos all loaded via zpm with the "-dev" flag, git-source-control will know the right place for everything to go and you can edit multiple projects under a single isfs folder in VSCode (or via Studio). Note, you may need to be more explicit than previously needed with the Directory attribute on resources in module.xml to get things perfectly right. If there are needs that this won't quite meet, it may be possible to improve git-source-control to provide further configuration options.
go to post Timothy Leavitt · Jun 21, 2023 @Gautam Rishi some things that would be helpful / might be worth looking into: Does the user IRIS runs as (most likely irisusr) have access to /Users/abc/workspace? If not I'd imagine all sorts of things could go wrong. (And git-source-control could be more helpful by making the root cause more obvious.) Where specifically is the error coming from? The error #5001 / message there doesn't seem to be in the git-source-control codebase, at least that I can find. If you set ^%oddENV("callererrorinfo")=2 it'll typically put the full stack trace in the error message. Just be sure to kill ^%oddENV("callererrorinfo") later so you don't keep getting it because it's noisy/annoying if you don't need it. What IRIS version are you running? (write $zv) In general, feel free to file a GitHub issue at https://github.com/intersystems/git-source-control/issues
go to post Timothy Leavitt · May 10, 2023 Turns out that it's as simple as putting classmethod="0" in your <script> tag... and then getting a helpful error message on compilation that you can't actually do that in a CSP page. 😂
go to post Timothy Leavitt · Apr 24, 2023 Hi @Michael Davidovich - it's been a while! Here's a quick sample for how I'd do this: Class Mike.Demo.REST Extends %CSP.REST { /// This method gets called prior to dispatch of the request. Put any common code here /// that you want to be executed for EVERY request. If pContinue is set to 0, the /// request will NOT be dispatched according to the UrlMap. In this case it's the /// responsibility of the user to return a response. ClassMethod OnPreDispatch(pUrl As %String, pMethod As %String, ByRef pContinue As %Boolean) As %Status { #dim %request As %CSP.Request Set pContinue = 0 Set version = %request.GetCgiEnv("HTTP_X_API_VERSION","unspecified; use X-API-VERSION header") Set class = $Case(+version, 1:"Mike.Demo.v1", 2:"Mike.Demo.v2", :"") If (class = "") { Set error = $$$ERROR($$$GeneralError,$$$FormatText("Invalid API version: %1",version)) // Shoud be HTTP 400, but you probably want to report this differently/better. Do ..ReportHttpStatusCode(..#HTTP400BADREQUEST,error) Quit $$$OK } Quit $classmethod(class,"DispatchRequest",pUrl,pMethod,1) } } Class Mike.Demo.v1 Extends %CSP.REST { Parameter VERSION = 1; XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] { <Routes> <Route Url="/version" Method="GET" Call="GetVersion" /> </Routes> } ClassMethod GetVersion() As %Status { Write {"version":(..#VERSION)}.%ToJSON() Quit $$$OK } } Class Mike.Demo.v2 Extends Mike.Demo.v1 { Parameter VERSION = 2; XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] { <Routes> <Route Url="/version" Method="GET" Call="GetVersion" /> </Routes> } }
go to post Timothy Leavitt · Apr 19, 2023 The standard approach for this in ObjectScript is the $$$FormatText macro - for example: Class Demo.Text { ClassMethod Sample() { Write $$$FormatText("Watch out %1, it's a %2!","Superman","large pizza made of Kryptonite") } } Results in: d ##class(Demo.Text).Sample() Watch out Superman, it's a large pizza made of Kryptonite!
go to post Timothy Leavitt · Apr 12, 2023 Set source = "NAMESPACE1" Set target = "NAMESPACE2" Kill ^|target|oddDEF(classname) Merge ^|target|oddDEF(classname) = ^|source|oddDEF(classname) New $Namespace Set $Namespace = target $$$ThrowOnError($System.OBJ.Compile(classname,"ck")) EDIT: Don't do this. Everybody should ignore me and do what @Chad Severtson said instead.