Skip to content

Port of FDC3 Conformance to Monorepo #1576

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

robmoffat
Copy link
Member

@robmoffat robmoffat commented Apr 16, 2025

Describe your change

  • Ported FDC3 Conformance Project as-is into the FDC3 Monorepo, just including minimal fixes for typescript compilation.
  • Removed 1.2-only tests.
  • Brought up-to-date to use getAgent.
  • This doesn't add new 2.2 conformance tests yet (see separate PR)

Review Checklist

  • CHANGELOG: Is a CHANGELOG.md entry included?

@robmoffat robmoffat requested a review from a team as a code owner April 16, 2025 07:35
Copy link

netlify bot commented Apr 16, 2025

Deploy Preview for fdc3 ready!

Name Link
🔨 Latest commit 6dc0a75
🔍 Latest deploy log https://app.netlify.com/sites/fdc3/deploys/680b4fd55bcc700008d525a7
😎 Deploy Preview https://deploy-preview-1576.preview-fdc3.finos.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@robmoffat robmoffat changed the title Port of FDC3 Conformance to Monorepo (NOT FOR REVIEW) Port of FDC3 Conformance to Monorepo Apr 25, 2025
Copy link

506 passed

Copy link

github-actions bot commented Apr 25, 2025

Coverage Report

Commit: 6dc0a75
Base: main@45101c3

Type Base This PR
Total Statements Coverage  97.66%  97.66% (+0%)
Total Branches Coverage  87.07%  87.07% (+0%)
Total Functions Coverage  96.65%  96.65% (+0%)
Total Lines Coverage  97.74%  97.74% (+0%)
Details (changed files)
FileStatementsBranchesFunctionsLines
Details (all files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/index.ts 100% 100% 62.5% 100%
packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts 88% 50% 100% 88%
packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts 98.71% 100% 94.44% 100%
packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts 97.29% 66.66% 100% 97.29%
packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts 100% 60% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts 100% 90% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts 100% 77.77% 100% 100%
packages/fdc3-agent-proxy/src/listeners/EventListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts 93.33% 72.72% 100% 93.33%
packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts 94.59% 100% 80% 94.59%
packages/fdc3-agent-proxy/src/util/AbstractFDC3Logger.ts 100% 94.11% 100% 100%
packages/fdc3-agent-proxy/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/index.ts 100% 100% 28.57% 100%
packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/message-port.ts 97.43% 86.66% 100% 97.43%
packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts 97.36% 89.47% 100% 97.36%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 77.77% 100% 100%
packages/fdc3-get-agent/src/strategies/FailoverHandler.ts 100% 76.47% 100% 100%
packages/fdc3-get-agent/src/strategies/HelloHandler.ts 94% 81.25% 100% 94%
packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts 95.65% 73.33% 100% 95.65%
packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts 98.48% 86.95% 100% 98.46%
packages/fdc3-get-agent/src/strategies/Timeouts.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts 97.14% 71.42% 100% 97.01%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts 100% 75% 100% 100%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts 100% 90% 100% 100%
packages/fdc3-get-agent/src/ui/NullChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/NullIntentResolver.ts 100% 100% 66.66% 100%
packages/fdc3-get-agent/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/util/Uuid.ts 100% 100% 100% 100%
packages/fdc3-standard/src/index.ts 100% 100% 0% 100%
packages/fdc3-standard/src/api/Errors.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/GetAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Methods.ts 94.04% 84.05% 96.29% 95%
packages/fdc3-standard/src/api/RecommendedChannels.ts 100% 100% 100% 100%
packages/fdc3-standard/src/context/ContextType.ts 100% 100% 100% 100%
packages/fdc3-standard/src/intents/Intents.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/contextConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/intentConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/typeHelpers.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts 96.87% 84.21% 100% 96.55%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts 96.38% 86.41% 100% 96.12%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts 88.23% 71.87% 86.66% 90%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts 97.96% 91.66% 100% 97.68%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts 97.14% 86.84% 100% 97.14%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts 100% 100% 100% 100%

Copy link

506 passed

@robmoffat
Copy link
Member Author

@kriswest the other day you asked if we could make sure the names of the tests line up with the documentation. I've done some analysis and it seems like they already are.

Test ID TypeScript Source File Present Name if Different
GetAgentAPI Not found No -
BasicCL1 fdc3.basic.ts Yes -
BasicCL2 fdc3.basic.ts Yes -
BasicIL1 fdc3.basic.ts Yes -
BasicGI1 fdc3.basic.ts Yes -
BasicAC1 fdc3.basic.ts Yes -
BasicUC1 fdc3.basic.ts Yes -
BasicJC1 fdc3.basic.ts Yes -
BasicRI1 fdc3.basic.ts Yes -
BasicRI2 fdc3.basic.ts Yes -
2.0-ACBasicUsage1 fdc3.app-channels.ts Yes -
2.0-ACBasicUsage2 fdc3.app-channels.ts Yes -
2.0-ACFilteredContext1 fdc3.app-channels.ts Yes -
2.0-ACFilteredContext2 fdc3.app-channels.ts Yes -
2.0-ACFilteredContext3 fdc3.app-channels.ts Yes -
2.0-ACFilteredContext4 fdc3.app-channels.ts Yes -
2.0-ACUnsubscribe fdc3.app-channels.ts Yes -
2.0-ACContextHistoryTyped fdc3.app-channels.ts Yes -
2.0-ACContextHistoryMultiple fdc3.app-channels.ts Yes -
2.0-ACContextHistoryLast fdc3.app-channels.ts Yes -
2.0-UCBasicUsage1 fdc3.user-channels.ts Yes -
2.0-UCBasicUsage2 fdc3.user-channels.ts Yes -
2.0-UCBasicUsage3 fdc3.user-channels.ts Yes -
2.0-UCBasicUsage4 fdc3.user-channels.ts Yes -
2.0-UCFilteredUsage1 fdc3.user-channels.ts Yes -
2.0-UCFilteredUsage2 fdc3.user-channels.ts Yes -
2.0-UCFilteredUsage3 fdc3.user-channels.ts Yes -
2.0-UCFilteredUsage4 fdc3.user-channels.ts Yes -
2.0-UCFilteredUsage5 fdc3.user-channels.ts Yes -
2.0-UCFilteredUsage6 fdc3.user-channels.ts Yes -
2.0-UCFilteredUsageChange fdc3.user-channels.ts Yes -
2.0-UCFilteredUsageUnsubscribe fdc3.user-channels.ts Yes -
2.0-UCFilteredUsageLeave fdc3.user-channels.ts Yes -
2.0-UCFilteredUsageNoJoin fdc3.user-channels.ts Yes -
2.2-ChannelChangedEvent Not found No -
2.0-GetAppMetadata fdc3.getAppMetadata.ts Yes -
2.0-AppInstanceMetadata fdc3.getAppMetadata.ts Yes -
2.0-FindInstances fdc3.findInstances.ts Yes -
2.0-GetInfo1 fdc3.getInfo.ts Yes -
2.0-GetInfo2 fdc3.getInfo.ts Yes -
2.0-AOpensB3 fdc3.open.ts Yes -
2.0-AOpensB4 fdc3.open.ts Yes -
2.0-AFailsToOpenB3 fdc3.open.ts Yes -
2.0-AOpensBWithContext3 fdc3.open.ts Yes -
2.0-AOpensBWithSpecificContext fdc3.open.ts Yes -
2.0-AOpensBMultipleListen fdc3.open.ts Yes -
2.0-AOpensBWithWrongContext fdc3.open.ts Yes -
2.0-FindIntentAppD fdc3.findIntent.ts Yes -
2.0-FindNonExistentIntentAppD fdc3.findIntent.ts Yes -
2.0-FindIntentAppDRightContext fdc3.findIntent.ts Yes -
2.0-FindIntentAppDWrongContext fdc3.findIntent.ts Yes -
2.0-FindIntentAppDMultiple1 fdc3.findIntent.ts Yes -
2.0-FindIntentAppDMultiple2 fdc3.findIntent.ts Yes -
2.0-FindIntentByContextSingleContext fdc3.findIntentsByContext.ts Yes -
2.0-FindIntentByContextWrongIntentAppD fdc3.findIntentsByContext.ts Yes -
2.0-FindIntentAppDByResultSingle fdc3.findIntent.ts Yes -
2.0-FindIntentAppDByResultSingleNullContext fdc3.findIntent.ts Yes -
2.0-FindIntentAppDByResultMultiple fdc3.findIntent.ts Yes -
2.0-FindIntentAppDByResultChannel1 fdc3.findIntent.ts Yes -
2.0-FindIntentAppDByResultChannel2 fdc3.findIntent.ts Yes -
2.0-RaiseIntentSingleResolve fdc3.raiseIntent.ts Yes -
2.0-RaiseIntentTargetedAppResolve fdc3.raiseIntent.ts Yes -
2.0-RaiseIntentTargetedInstanceResolveOpen fdc3.raiseIntent.ts Yes -
2.0-RaiseIntentTargetedInstanceResolveFindInstances fdc3.raiseIntent.ts Yes -
2.0-RaiseIntentFailedResolve fdc3.raiseIntent-NoAppsFound.ts Yes -
2.0-RaiseIntentFailTargetedAppResolve1 fdc3.raiseIntent-NoAppsFound.ts Yes -
2.0-RaiseIntentFailTargetedAppResolve2 fdc3.raiseIntent-NoAppsFound.ts Yes -
2.0-RaiseIntentFailTargetedAppResolve3 fdc3.raiseIntent-NoAppsFound.ts Yes -
2.0-RaiseIntentFailTargetedAppResolve4 fdc3.raiseIntent-NoAppsFound.ts Yes -
2.0-RaiseIntentFailTargetedAppInstanceResolve1 fdc3.raiseIntent-NoAppsFound.ts Yes -
2.0-RaiseIntentFailTargetedAppInstanceResolve2 fdc3.raiseIntent-NoAppsFound.ts Yes -
2.0-RaiseIntentVoidResult0secs fdc3.raiseIntent-Result.ts Yes -
2.0-RaiseIntentVoidResult5secs fdc3.raiseIntent-Result.ts Yes -
2.0-RaiseIntentVoidResult61secs fdc3.raiseIntent-Result.ts Yes -
2.0-RaiseIntentContextResult0secs fdc3.raiseIntent-Result.ts Yes -
2.0-RaiseIntentContextResult5secs fdc3.raiseIntent-Result.ts Yes -
2.0-RaiseIntentContextResult61secs fdc3.raiseIntent-Result.ts Yes -
2.0-RaiseIntentChannelResult fdc3.raiseIntent-Result.ts Yes -
2.0-RaiseIntentPrivateChannelResult fdc3.raiseIntent-Result.ts Yes -
2.0-PrivateChannelsAreNotAppChannels fdc3.raiseIntent.ts Yes -
2.0-PrivateChannelsLifecycleEvents fdc3.raiseIntent.ts Yes -
2.0-ResolveAmbiguousIntentTarget fdc3.manual.ts Yes -
2.0-ResolveAmbiguousContextTarget fdc3.manual.ts Yes -
2.0-ResolveAmbiguousIntentTargetMultiInstance fdc3.manual.ts Yes -
2.0-ResolveAmbiguousContextTargetMultiInstance fdc3.manual.ts Yes -

Am I missing something?

@kriswest
Copy link
Contributor

kriswest commented Apr 25, 2025 via email

Copy link
Contributor

@julianna-ciq julianna-ciq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review of everything but the markdown files

I added suggestions for some typescript stuff - I tried to reduce the amount of as I saw. fyi @robmoffat @kriswest

NoListenerTimeout: 120000, // the amount of time to allow for a DA to timeout waiting on a context or intent listener
// FDC3 does not define this timeout so this should be extended if the DA uses a longer timeout
ControlChannel: 'app-control', //app channel used for passing messages between mock apps and tests
} as const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the as const for?

@@ -0,0 +1,26 @@
/** same in 1.2 and 2.0 */
export interface CommonContext {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use existing types from the monorepo? In the generated BrowserTypes file, I think the interface Context is the same as this one.

import { IChannelService } from './interfaces';

export class Fdc3CommandExecutor {
async executeCommands(orderedCommands: string[], config: ChannelsAppConfig, channelService: IChannelService<any>) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anti-pattern to use any. Is there something better we can use? Maybe a list of possible channel types? If not, can we change to unknown?

}
case commands.broadcastInstrumentContext: {
const contextType = config.contextId ? `fdc3.instrument.${config.contextId}` : 'fdc3.instrument';
await channelService.broadcastContextItem(contextType, channel, config.historyItems ?? 1, config.testId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible for channel to be undefined. Will that cause problems?

}
case commands.broadcastContactContext: {
const contextType = config.contextId ? `fdc3.contact.${config.contextId}` : 'fdc3.contact';
await channelService.broadcastContextItem(contextType, channel, config.historyItems ?? 1, config.testId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible for channel to be undefined. Will that cause problems?

Comment on lines +18 to +21
appControlChannel.broadcast({
type: 'closeWindow',
testId: currentTest,
} as AppControlContext);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
appControlChannel.broadcast({
type: 'closeWindow',
testId: currentTest,
} as AppControlContext);
const testContext: AppControlContext = {
type: 'closeWindow',
testId: currentTest,
};
appControlChannel.broadcast(testContext);

Comment on lines +14 to +17
await sendContextToTests(fdc3, {
type: ControlContextType.CONTEXT_RECEIVED,
context: context,
} as AppControlContext);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await sendContextToTests(fdc3, {
type: ControlContextType.CONTEXT_RECEIVED,
context: context,
} as AppControlContext);
const testContext: AppControlContext = {
type: ControlContextType.CONTEXT_RECEIVED,
context: context,
};
await sendContextToTests(fdc3, testContext);

Comment on lines +22 to +25
await sendContextToTests(fdc3, {
type: ControlContextType.CONTEXT_RECEIVED,
errorMessage: message,
} as AppControlContext);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await sendContextToTests(fdc3, {
type: ControlContextType.CONTEXT_RECEIVED,
errorMessage: message,
} as AppControlContext);
const testContext: AppControlContext = {
type: ControlContextType.CONTEXT_RECEIVED,
errorMessage: message,
};
await sendContextToTests(fdc3, testContext);

Comment on lines +9 to +12
await appControlChannel.broadcast({
type: 'windowClosed',
testId: context.testId,
} as AppControlContext);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await appControlChannel.broadcast({
type: 'windowClosed',
testId: context.testId,
} as AppControlContext);
const testContext: AppControlContext = {
type: 'windowClosed',
testId: context.testId,
};
await appControlChannel.broadcast(testContext);

Comment on lines +12 to +15
await sendContextToTests(fdc3, {
type: ControlContextType.CONTEXT_RECEIVED,
errorMessage: `Listener received incorrect context type. Listener listening for 'shouldNotReceiveThisContext' type received '${context.type}' type`,
} as AppControlContext);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await sendContextToTests(fdc3, {
type: ControlContextType.CONTEXT_RECEIVED,
errorMessage: `Listener received incorrect context type. Listener listening for 'shouldNotReceiveThisContext' type received '${context.type}' type`,
} as AppControlContext);
const testContext: AppControlContext = {
type: ControlContextType.CONTEXT_RECEIVED,
errorMessage: `Listener received incorrect context type. Listener listening for 'shouldNotReceiveThisContext' type received '${context.type}' type`,
};
await sendContextToTests(fdc3, testContext);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants