Skip to content

Latest commit

History

169 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Serverless Functions Console

A Functions-as-a-Service PoC UI for the OpenShift Web Console. Developers create, edit, and deploy serverless functions without CLI knowledge.

Built as an OpenShift Console dynamic plugin using Go, React, TypeScript, and PatternFly 6.

Team Values

  • Support each other and find time for each other
  • Deliver high quality output
  • Communicate often and speak freely without hesitation
  • Care about bringing value to the customer

Guides

GuideDescription
Agile WorkflowIssue tracking, branching, pull requests
ArchitectureLayered architecture, dependency rules, and React patterns
Style GuideCode style, naming conventions, commit conventions, CSS rules, and OCP plugin constraints
TestingTDD approach, test layers, mock strategy, and file conventions

Templates

TemplateDescription
PR TemplatePull request description format
Jira EpicTemplate for creating Jira epics
Jira StoryTemplate for creating Jira stories
Jira BugTemplate for filing Jira bugs

Slash Commands

CommandDescription
/beginStart a session, orient, and pick work
/commitCreate a git commit
/create-prRun pre-checks, review, and create a PR
/e2eScaffold and debug Playwright e2e tests
/scrutiniseCritically review your own output

ChatOps

PRs merge via Prow when they have both approved and lgtm labels.

CommandWhat it does
/lgtmApprove for merge (or use GitHub review approval)
/approveOWNERS approval
/holdBlock merge
/retestRe-run failed CI jobs
/test e2e-awsRun e2e CI job

All available commands for this repo.

Deployment on cluster

Prerequisites

Quick Install (via Operator)

Installs OpenShift Serverless, Knative Serving, and the Functions operator (which deploys the console plugin). The operator catalog always contains the latest console plugin build, kept current automatically by Konflux.

# 1. Install the operators
oc apply -f https://raw.githubusercontent.com/openshift/faas-console-plugin/master/install.yaml
# 2. Install Knative Serving (requires the Serverless operator CRDs)
oc apply -f - <<EOFapiVersion: operator.knative.dev/v1beta1kind: KnativeServingmetadata: name: knative-serving namespace: knative-servingspec: {}EOF# 3. Enable the console plugin - can also be done through the UI
oc patch consoles.operator.openshift.io cluster --type=json \
--patch='[{"op":"add","path":"/spec/plugins/-","value":"console-functions-plugin"}]'

Development

Prerequisites

  • Node.js (v24+)
  • Yarn (v4)
  • Go (v1.26+)
  • Helm
  • oc CLI
  • Podman (v3.2.0+)
  • An OpenShift cluster
  • Github Personal Access Token with administration, content and workflow write permissions in all repositories
  • gh CLI (optional, enables your agent to create/update PRs)
  • fswatch (optional, enables Go backend auto-recompile on file changes)
  • Superpowers (optional, enables your coding agents to brainstorm, write plans, use tdd, etc.)
  • Jira CLI (optional, enables your coding agent to read Jira tickets)

Cluster setup

oc login ...
make setup-serverless # install Serverless operator + Knative Serving (optional)

Setup

make dev # build + start webpack + console container
make dev-stop # stop dev environment
make dev-randomize-ports # start with random ports (when defaults are in use)

Navigate to http://localhost:9000 to see the running plugin.

Testing

make unit # frontend + backend unit tests
make test-e2e # Playwright e2e (requires make dev running)
make test-e2e ARGS="--headed"# visible browser
make test-e2e ARGS="--ui"# interactive UI mode

See docs/TESTING.md for full conventions, helpers, and environment variables.

Deploy to cluster

To deploy a production-like image to the cluster instead of running locally:

make deploy-dev # build image, push to internal registry, deploy

i18n

The plugin uses react-i18next for translations, with i18next-cli for string extraction and TypeScript type generation. The i18n namespace must match the name of the ConsolePlugin resource with the plugin__ prefix to avoid naming conflicts. This plugin uses the plugin__console-functions-plugin namespace.

You can use the useTranslation hook with this namespace as follows:

constHeader: React.FC=()=>{const{ t }=useTranslation('plugin__console-functions-plugin');return<h1>{t('Hello, World!')}</h1>;};

For labels in console-extensions.json, you can use the format %plugin__console-functions-plugin~My Label%. Console will replace the value with the message for the current language from the plugin__console-functions-plugin namespace. For example:

 {
"type": "console.navigation/section",
"properties": {
"id": "functions-section",
"perspective": "admin",
"name": "%plugin__console-functions-plugin~Serverless Functions%"
}
}

Running make verify checks i18n freshness and extracts translatable strings into the JSON files in the locales folder. The extraction configuration is in i18next.config.ts.

Linting

This project adds prettier, eslint, stylelint, and golangci-lint. Linting can be run with make lint.

The stylelint config disallows defining colors since these cause problems with dark mode. Use PatternFly semantic tokens for colors instead.

The stylelint config also disallows naked element selectors like table and .pf- or .co- prefixed classes. This prevents plugins from accidentally overwriting default console styles, breaking the layout of existing pages. The best practice is to prefix your CSS class names with your plugin name to avoid conflicts. Please don't disable these rules without understanding how they can break console styles!

References

About

A FaaS UI for the OpenShift Web Console. Create, edit, and deploy serverless functions without CLI knowledge.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages