1 all webstore version
1 By Restore point records are available
2 By webstore lifecycle remarks
3 By log to the Sana side and verifying the image is changed
4 By log lens side and verify
all versions should same
1 all webstore version
1 By Restore point records are available
2 By webstore lifecycle remarks
3 By log to the Sana side and verifying the image is changed
4 By log lens side and verify
all versions should same
Addon
1 CodeSpell checker : street side software
2 Cypress Snippets
Show Reference count
https://stackoverflow.com/questions/45490475/how-do-i-show-reference-count-in-visual-studio-code
Menu File → Preferences → Settings:
Search CodeLens.
click extension > type Emojisense
install
file:///C:/Users/s.kodagoda/Downloads/Recordings/WebstoreHealthChecks.webm
https://ismegroup-my.sharepoint.com/personal/k_samaraweera_sana-commerce_com/_layouts/15/stream.aspx?id=%2Fpersonal%2Fk%5Fsamaraweera%5Fsana%2Dcommerce%5Fcom%2FDocuments%2FRecordings%2FCall%20with%20Chamath%20and%201%20other%2D20230302%5F131457%2DMeeting%20Recording%2Emp4&ga=1
The job will run 15/30 min rounds.
if no one attends to it within 30 min
then 2nd 30min Will create a ticket in Azure support dashboard
https://sanacommerce.visualstudio.com/Sana%20Platform/_dashboards/dashboard/2e484f6f-c1e0-4af3-87fa-ee646881715e
it will create a record in the WebstoreHealthChecks table
1.00pm | Email Send 1 | TicketCreated 0
1.30pm | Email Send 1 | TicketCreated 1
Sana.Platform.Core > ConstantModels > Enums > HealthCheckType.cs
HealthCheckTypes Enum (InProgress/ Failed)
0 InProgress WebJobCheck
1 Failed WebjobCheck
2 InProgress BackupCronJobCheck
3 Failed BackupCronJobCheck
4 InProgress HttpMonitoringConfiguration
5 Failed HttpMonitoringConfiguration
WebJobCheck: eg Installation, Activation,Restart, SSL,OpenVPN
BackupCronJobCheck: eg Backup
HttpMonitoringConfiguration: eg Http Monitoring :
Use for Testing
select * from WebstoreHealthChecks
select * from WebStoreStates
update WebStores set WebStoreStateId =10 where WebStoreId = 1000
update WebStores set WebStoreStateId =9, ModifiedDateTime = '2023-03-02 05:34:27.867' where WebStoreId = 1000
update [dbo].[WebstoreHealthChecks] set [IsTicketCreated] =0 where WebStoreId ='57055'
Table column Explain
[Id]: unique id
,[WebStoreId]
,[HealthCheckType] : HealthCheckType enum
,[IsEmailSent]: is the email sent or not
,[IsTicketCreated] is the ticket
,[Description]: Email and ticked desc
,[WebstoreLifeCycleId]: Get the Last Stause of webstore
,[CheckExecutionDateTime]: after failed time which fail to check identify if (ticket Created date)
,[FailureOccuredTime]: Issue Failed time
,[CreatedUser]
,[CreatedDateTime]
,[ModifiedUser]
,[ModifiedDateTime]
to check the Fail scenarios update the webstore as follows
* update WebStores set WebStoreStateId =10 (uninstall inprogress)
where WebStoreId = 1000
to check inprogress/stuck senarios update webstore as folowing
* update WebStores set WebStoreStateId =9,
ModifiedDateTime = '2023-03-02 05:34:27.867' (set -2hr or old) ex: now:10pm set to 8pm
where WebStoreId = 1000
Now job will take 2hr old data
can change the config table [CloudConfigs] Table
or Sana,Platform.Portal > Local > CloudConfigs.sql
SELECT * FROM [dbo].[CloudConfigs] where [key] = 'WebjobTaskWaitingDuration'
?? Better to have Ticket ID in table
DECLARE @WebStoreStateId INT;
DECLARE @WebStoreId INT;
DECLARE @LogType INT;
DECLARE @Date DATETIME
SET @Date = GETDATE()
SET @WebStoreStateId = 26;
SET @WebStoreId = 58719
SET @LogType =5
--1 Update webstore as fail
Update WebStores set WebStoreStateId =@WebStoreStateId where WebStoreId = @WebStoreId
--2 Insert life cycle
INSERT INTO [dbo].[WebstoreLifeCycles]
([WebStoreId]
,[WebStoreStateId]
,[User]
,[Comment],[LifeCycleDate]
)
VALUES
(@WebStoreId
,@WebStoreStateId,
'400',
'Failed Applied by Manualy',
@Date)
--3. Add WebStoreLogs to attach error log
INSERT INTO [dbo].[WebStoreLogs]
([WebStoreId]
,[LogMessage]
,[LogType]
,[IsExceptionOccured]
,[LogDateTime])
VALUES
(
@WebStoreId
,'<ArrayOfSanaCloudLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SanaCloudLog>
<LogMessage>Job Failed Applied by Manually</LogMessage>
</SanaCloudLog>
</ArrayOfSanaCloudLog>
'
,@LogType
,1
,@Date)
--------------------------------------------------------------------
SELECT * from WebStores where WebStoreId = 58719
SELECT * from [dbo].[WebstoreLifeCycles] where WebStoreId = 58719
SELECT * FROM [dbo].[WebstoreHealthChecks] where WebStoreId = 58719
select * from [dbo].[WebStoreLogs] where WebStoreId = 58719
To Run web job manually
https://portal.azure.com/#home
go tot > App services
Search webjobSearch by browser (ctr + F)
WebstoreHealthCheck
Click run
---------------------------------------------------------------------------
Click enable
the schedule will run after midnight
else update time from DB
update [dbo].[WebstoreApplicationInsights] set [ScheduledDate] = '2023-01-03 00:00:00.000'
where [WebstoreId] = 58671
After install
To verify
1 https://portal.azure.com/#home >
https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/microsoft.insights%2Fcomponents
2 copy app name from overview page
3 search the name
4. application insightmove to region
https://testautomationu.applitools.com/cypress-with-typescript/chapter1.html
install type script Globerly
To view all different commands and flages
> tsc
it will convert TS file to JS
Cypress Auto-completion use following
but when using type script by adding default type script config file
references will help auto load
tsconfig.ts
custom commands on Type script and add header description
Add example
function is not use anymore/ obsalete
@deprecated
When having error on XPath with type script
tsconfig.json file."cypress-xpath"
2 import "cypress-xpath" to command.ts file
Set specific value without using constent values
Create file helper\Typing\Placeholders.ts
create method using above mention types
when use it,only able to type given values
Change class to models
https://stackoverflow.com/questions/32805559/typescript-es6-import-module-file-is-not-a-module-error
// test.js - exporting es6
export module App {
export class SomeClass {
getName(): string {
return 'name';
}
}
export class OtherClass {
getName(): string {
return 'name';
}
}
}And now we can import it with these thre ways:
import * as app1 from "./test";
import app2 = require("./test");
import {App} from "./test";And we can consume imported stuff like this:
var a1: app1.App.SomeClass = new app1.App.SomeClass();
var a2: app1.App.OtherClass = new app1.App.OtherClass();
var b1: app2.App.SomeClass = new app2.App.SomeClass();
var b2: app2.App.OtherClass = new app2.App.OtherClass();
var c1: App.SomeClass = new App.SomeClass();
var c2: App.OtherClass = new App.OtherClass();and call the method to see it in action:
console.log(a1.getName())
console.log(a2.getName())
console.log(b1.getName())
console.log(b2.getName())
console.log(c1.getName())
console.log(c2.getName())change json imports to
old (it will not read data inside)
New
DECLARE @TestId AS VARCHAR(100)='58311'
delete FROM [SanaPlatform].[dbo].[WebStoreAzureSettings] where [WebStoreId] =@TestId
delete FROM [SanaPlatform].[dbo].[WebstoreDatabaseUsers] where [WebStoreId] =@TestId
delete FROM [SanaPlatform].[dbo].[WebStoreDomains] where [WebStoreId] =@TestId
delete FROM [SanaPlatform].[dbo].[WebstoreEmailSettings] where [WebStoreId] =@TestId
delete FROM [SanaPlatform].[dbo].[WebstoreInfoEmailSentLogs] where [WebStoreId] =@TestId
delete FROM [SanaPlatform].[dbo].[WebstoreLifeCycles] where [WebStoreId] =@TestId
delete FROM [SanaPlatform].[dbo].[WebstoreMaintenanceEmails] where [WebStoreId] =@TestId
delete FROM [SanaPlatform].[dbo].[WebStores] where [WebStoreId] = @TestId
Webstore with azure side settings
[dbo].[WebStoreAzureSettings]
can get webstore installation profile id created by cluster wise
make Hard coded Partner called: "Sana team undetermined"
Create projects called: Undetermined
If the partner is not sure then create as undetermined.
Partner ==> WebstoreInstallationProfiles ==> WebStoreAzureSettings