Skip to content

Commit

Permalink
chore!: bump primer backend, adapt to new selection info api
Browse files Browse the repository at this point in the history
When selecting a non-empty hole, the API now emits information about
both the expected and actual types. We adapt to this change by ignoring
the actual type and just displaying the expected one (this matches the
behaviour with the old backend version). In a subsequent commit we will
show both.

BREAKING CHANGE: the API is different from the previous backend pin. Thus
this version of the frontend cannot talk to the previous version of the
backend and vice versa.

Signed-off-by: Ben Price <[email protected]>
  • Loading branch information
brprice committed Nov 9, 2023
1 parent 3c1937b commit c331701
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 65 deletions.
2 changes: 1 addition & 1 deletion argocd/base/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
# Note: use the *dev* version of the package here, so that
# PRs can deploy `primer-service` container images that have
# not yet been merged to `primer` `main`.
image: ghcr.io/hackworthltd/primer-service-dev:git-2bf2349473b60fc6a99e9a553dcd1b0fd9d54b5f
image: ghcr.io/hackworthltd/primer-service-dev:git-eca550da908c793ce35d7428cb06dec6671ed67f
ports:
- containerPort: 8081
env:
Expand Down
134 changes: 76 additions & 58 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Note: don't override any of primer's Nix flake inputs, or else
# we won't hit its binary cache.
primer.url = github:hackworthltd/primer/2bf2349473b60fc6a99e9a553dcd1b0fd9d54b5f;
primer.url = github:hackworthltd/primer/eca550da908c793ce35d7428cb06dec6671ed67f;

flake-parts.url = "github:hercules-ci/flake-parts";
};
Expand Down
3 changes: 2 additions & 1 deletion src/components/SelectionInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ const TypeOrKindTree = (p: {
fitView({ padding });
};

const tk = p.typeOrKind.contents;
return (
<TreeReactFlowOne
{...defaultTreeReactFlowProps}
tree={p.typeOrKind.contents}
tree={tk.tag === "Ok" ? tk.contents : tk.expected}
level={p.level}
zoomBarProps={{ padding }}
onNodesChange={onNodesChange}
Expand Down
5 changes: 5 additions & 0 deletions src/primer-api/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export * from './nodeFlavorPrimBody';
export * from './nodeFlavorTextBody';
export * from './nodeSelection';
export * from './nodeType';
export * from './okOrMismatch';
export * from './okOrMismatchOneOf';
export * from './okOrMismatchOneOfTag';
export * from './okOrMismatchOneOfThree';
export * from './okOrMismatchOneOfThreeTag';
export * from './option';
export * from './options';
export * from './paginatedMeta';
Expand Down
11 changes: 11 additions & 0 deletions src/primer-api/model/okOrMismatch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Generated by orval v6.19.1 🍺
* Do not edit manually.
* Primer backend API
* A backend service implementing a pedagogic functional programming language.
* OpenAPI spec version: 0.7
*/
import type { OkOrMismatchOneOf } from './okOrMismatchOneOf';
import type { OkOrMismatchOneOfThree } from './okOrMismatchOneOfThree';

export type OkOrMismatch = OkOrMismatchOneOf | OkOrMismatchOneOfThree;
14 changes: 14 additions & 0 deletions src/primer-api/model/okOrMismatchOneOf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Generated by orval v6.19.1 🍺
* Do not edit manually.
* Primer backend API
* A backend service implementing a pedagogic functional programming language.
* OpenAPI spec version: 0.7
*/
import type { Tree } from './tree';
import type { OkOrMismatchOneOfTag } from './okOrMismatchOneOfTag';

export type OkOrMismatchOneOf = {
contents: Tree;
tag: OkOrMismatchOneOfTag;
};
Loading

0 comments on commit c331701

Please sign in to comment.