Skip to content

Conversation

@j7m4
Copy link
Collaborator

@j7m4 j7m4 commented Mar 25, 2025

Summary by CodeRabbit

  • Refactor
    • Consistently renamed all filtering-related terminology to “condition” and “selector” across the application. This update aligns state management, API queries, and schema properties with the new naming convention.
  • Chores
    • Adjusted UI labels and URL parameters (e.g., “Edit filter” now appears as “Edit selector” and search placeholders were updated) without altering core functionality.
    • Updated database columns and API documentation to reflect these naming changes, ensuring consistency throughout the system.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2025

Walkthrough

This pull request introduces systematic renaming throughout the codebase to replace “filter” terminology with “condition” (or “selector” when applicable). Types, variables, hook names, API query parameters, database fields, and OpenAPI schemas have all been updated. For example, FilterType becomes ConditionType, JobFilterType becomes JobConditionType, and variables such as resourceFilter are now resourceSelector. Additionally, a new hook named useCondition replaces the deprecated useFilter, ensuring consistency in state management across both frontend and backend components.

Changes

File(s) Change Summary
apps/webservice/.../EnvironmentNode.tsx, .../ResourceReleaseTable.tsx, .../DeploymentPageContent.tsx Renamed imports and variables (e.g. FilterTypeConditionType, JobFilterTypeJobConditionType); updated UI hooks from useFilter to useCondition; changed API query keys from filter to condition and variable names from resourceFilter to resourceSelector.
apps/webservice/.../JobHistoryPopover.tsx, .../TableCells.tsx, .../DeploymentVersionChannelDropdown.tsx, .../ResourceViewsTable.tsx Updated sidebar and job components to reflect new condition-based naming; modified prop names, labels, and URL parameters (e.g. from “Clear filter” to “Clear selector”).
apps/webservice/.../api/v1/*.ts In OpenAPI and router files, properties such as resourceFilter and releaseFilter have been renamed to resourceSelector and releaseSelector; query parameters and error messages updated accordingly.
packages/api/..., packages/db/..., packages/validators/... Renamed types across backend modules (e.g. FilterTypeConditionType, ResourceFilterTypeResourceConditionType, JobFilterTypeJobConditionType); database schema files and SQL migrations update column names (e.g. resource_filterresource_selector); removal of obsolete hooks.
apps/webservice/.../useResourceCondition.ts, apps/webservice/.../useCondition.ts Refactored hooks and utility functions to adopt the new naming conventions; replaced useFilter with the new useCondition and updated parameter names accordingly.

Possibly related PRs

Poem

I'm a little rabbit coding in delight,
Hopping through changes with names shining bright.
Filters turn to conditions with a graceful twist,
Resource selectors now make a perfect list.
With every rename my heart skips a beat—
Code so clear and charming, oh so neat!
Hip hip, hop on; the refactor's complete!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@j7m4 j7m4 marked this pull request as draft March 25, 2025 23:41
@j7m4 j7m4 changed the title J7m4/refactor release filter to selector J7m4/refactor filter to selector Mar 25, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🔭 Outside diff range comments (13)
apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/Overview.tsx (1)

185-186: ⚠️ Potential issue

Inconsistent terminology: UI text "Release Filter" should be updated.

While the code references have been updated to use "selector" terminology, the UI text here still uses "Release Filter". For consistency with the PR's purpose of refactoring from filter to selector, this should be updated to "Release Selector".

-                Release Filter
+                Release Selector
apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceSelector.ts (1)

37-39: ⚠️ Potential issue

Inconsistency in URL parameter naming.

While most of the code has been updated to use "selector" terminology, this section still uses "filter" in the URL parameters.

Apply this diff to maintain consistent terminology:

if (filterJsonHash != null)
-  url.searchParams.set("filter", filterJsonHash);
-if (filterJsonHash == null) url.searchParams.delete("filter");
+  url.searchParams.set("selector", filterJsonHash);
+if (filterJsonHash == null) url.searchParams.delete("selector");
packages/job-dispatch/src/resource/utils.ts (1)

101-101: ⚠️ Potential issue

Missed field renaming in resource matching condition.

While most of the code has been updated to use "selector" terminology, line 101 still references env.resourceFilter which should be updated to maintain consistency.

Apply this diff to fix the inconsistency:

-                schema.resourceMatchesMetadata(tx, env.resourceFilter),
+                schema.resourceMatchesMetadata(tx, env.resourceSelector),
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/TableCells.tsx (1)

158-162: ⚠️ Potential issue

Missed FilterType reference

There's still a reference to FilterType.Comparison that needs to be updated to SelectorType.Comparison to maintain consistency with the other renames in this file.

const filter: JobCondition = {
-  type: FilterType.Comparison,
+  type: SelectorType.Comparison,
  operator: ComparisonOperator.And,
  conditions: [isSameVersion, isSameEnvironment],
};
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/_components/variables/VariableResourceInput.tsx (2)

30-58: ⚠️ Potential issue

Complete the refactoring of the useResourcesFromEnvironment function

The function parameter and return value still use "filter" terminology while the internal implementation has been updated to use "selector".

Apply these changes for consistency:

const useResourcesFromEnvironment = (
  system?: System,
-  existingFilter?: ResourceCondition,
+  existingSelector?: ResourceCondition,
) => {
  const { data: envs = [] } = api.environment.bySystemId.useQuery(
    system?.id ?? "",
    { enabled: system != null },
  );

-  const filter: ResourceCondition = {
+  const selector: ResourceCondition = {
    type: ResourceSelectorType.Comparison,
    operator: ResourceOperator.And,
    conditions: [
      {
        type: ResourceSelectorType.Comparison,
        operator: ResourceOperator.Or,
        conditions: envs.map((e) => e.resourceSelector).filter(isPresent),
      },
-      ...(existingFilter ? [existingFilter] : []),
+      ...(existingSelector ? [existingSelector] : []),
    ],
  };

  const { data, isLoading } = api.resource.byWorkspaceId.list.useQuery(
-    { workspaceId: system?.workspaceId ?? "", filter },
+    { workspaceId: system?.workspaceId ?? "", filter: selector },
    { enabled: system != null, placeholderData: (prev) => prev },
  );

-  return { filter, resources: data?.items ?? [], isLoading };
+  return { selector, resources: data?.items ?? [], isLoading };
};

60-94: ⚠️ Potential issue

Complete the refactoring of the useResourcesWithSearch function

The function still uses "filter" terminology in several places while part of the implementation has been updated to use "selector".

Apply these changes for consistency:

const useResourcesWithSearch = (
  system?: System,
-  existingFilter?: ResourceCondition,
+  existingSelector?: ResourceCondition,
) => {
  const [search, setSearch] = useState("");
  const {
-    filter: environmentFilters,
+    selector: environmentSelectors,
    resources,
    isLoading: allResourcesLoading,
-  } = useResourcesFromEnvironment(system, existingFilter);
+  } = useResourcesFromEnvironment(system, existingSelector);

-  const filterWithSearch: ResourceCondition = {
+  const selectorWithSearch: ResourceCondition = {
    type: ResourceSelectorType.Comparison,
    operator: ResourceOperator.And,
    conditions: [
-      environmentFilters,
+      environmentSelectors,
      {
        type: ResourceSelectorType.Name,
        operator: ColumnOperator.Contains,
        value: search,
      },
    ],
  };

  const {
    data: { items: resourcesWithSearch } = { items: [] },
    isLoading: textSeachResourcesLoading,
  } = api.resource.byWorkspaceId.list.useQuery(
-    { workspaceId: system?.workspaceId ?? "", filter: filterWithSearch },
+    { workspaceId: system?.workspaceId ?? "", filter: selectorWithSearch },
    { enabled: system != null, placeholderData: (prev) => prev },
  );

  const isLoading = textSeachResourcesLoading || allResourcesLoading;
  return { search, setSearch, resources, resourcesWithSearch, isLoading };
};
apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx (1)

90-109: 💡 Verification agent

🧩 Analysis chain

Inconsistent function naming.

While the hook has been updated to use setSelector, the component still uses setFilter in multiple places. This inconsistency should be addressed to maintain a uniform naming convention throughout the component.

Also applies to: 111-119, 137-138


🏁 Script executed:

#!/bin/bash
# Check for any remaining uses of setFilter in the ResourcePageContent component
rg -A 2 -B 2 "setFilter" "apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx"

Length of output: 900


Rename setFilter to setSelector for consistency across the component

There are several instances in the ResourcePageContent.tsx component where setFilter is still being used, despite the hook being updated to use setSelector. To avoid confusion and enforce a uniform naming convention, please update all the occurrences of setFilter in this file. This includes, but is not limited to:

  • The search condition update block (lines 90–109)
  • The second occurrence around lines 111–119
  • The filter update in the onFilterChange callback and usage in onSubmit/onClear (lines 137–138 and others)

Once these refactors are complete, the component will be aligned with the updated hook interface.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/jobs/release-table/ResourceReleaseTable.tsx (1)

502-509: ⚠️ Potential issue

Fix remaining reference to filter variable.

There's still a reference to the old filter variable at line 507, but the variable has been renamed to selector. This will cause a runtime error.

<JobConditionDialog condition={selector} onChange={setFilter}>
  <div className="flex items-center gap-2">
    <Button variant="ghost" size="icon" className="h-7 w-7">
      <IconFilter className="h-4 w-4" />
    </Button>
-   {filter != null && <JobConditionBadge condition={filter} />}
+   {selector != null && <JobConditionBadge condition={selector} />}
  </div>
</JobConditionDialog>
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableResourceInput.tsx (3)

71-82: ⚠️ Potential issue

Fix variable name inconsistency for environmentFilters.

The variable environmentFilters on line 75 should be updated to environmentSelectors to align with the global refactoring from "filter" to "selector".

const selectorWithSearch: ResourceCondition = {
  type: ResourceSelectorType.Comparison,
  operator: ResourceOperator.And,
  conditions: [
-   environmentFilters,
+   environmentSelectors,
    {
      type: ResourceSelectorType.Name,
      operator: ColumnOperator.Contains,
      value: search,
    },
  ],
};

88-90: ⚠️ Potential issue

Fix remaining API query parameter using "filter" instead of "selector".

The API query is still using filter: filterWithSearch instead of selector: selectorWithSearch which would break the functionality.

api.resource.byWorkspaceId.list.useQuery(
-  { workspaceId: system?.workspaceId ?? "", filter: filterWithSearch },
+  { workspaceId: system?.workspaceId ?? "", selector: selectorWithSearch },
  { enabled: system != null, placeholderData: (prev) => prev },
)

101-104: 🛠️ Refactor suggestion

Update component prop from filter to selector for consistency.

The component still accepts a filter prop even though all other occurrences have been renamed from "filter" to "selector". This should be updated for consistency.

export const VariableResourceInput: React.FC<
  ResourceVariableConfigType & {
    value: string;
    onChange: (v: string) => void;
  }
-> = ({ value, filter, onChange }) => {
+> = ({ value, selector, onChange }) => {
  const params = useParams<{ workspaceSlug: string; systemSlug: string }>();
  const { data: system } = api.system.bySlug.useQuery(params);

Then update line 106 to use selector instead of filter:

  const { search, setSearch, resources, resourcesWithSearch, isLoading } =
-   useResourcesWithSearch(system, filter);
+   useResourcesWithSearch(system, selector);

Note: This change might require additional updates in other files where this component is used.

openapi.v1.json (1)

2623-2646: ⚠️ Potential issue

Updated filter path parameter to selector in resources endpoint.

The path parameter in the endpoint for retrieving resources by filter has been changed from /filter to /selector. However, the parameter description on line 2644 and name on line 2638 still use "filter" terminology.

Update the parameter description and name to match the new terminology:

-    "name": "filter",
+    "name": "selector",
     "in": "path",
     "required": true,
     "schema": {
       "type": "string"
     },
-    "description": "Filter to apply to the resources"
+    "description": "Selector to apply to the resources"
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx (1)

108-108: ⚠️ Potential issue

Fix unnecessary conditional flagged by linter

There's a TypeScript ESLint error indicating an unnecessary conditional at this line. The error suggests that one of the values in this expression is always falsy.

This error isn't directly related to the changes in this PR but should be addressed. Check if either pendingJobsQ.isLoading or inProgressJobsQ.isLoading is always false in your use case, or if there's a more accurate way to determine the loading state.

🧰 Tools
🪛 GitHub Check: Lint

[failure] 108-108:
Unnecessary conditional, value is always falsy

🪛 GitHub Actions: CI

[error] 108-108: Unnecessary conditional, value is always falsy @typescript-eslint/no-unnecessary-condition

🧹 Nitpick comments (19)
packages/emails/src/Welcome.jsx (2)

4-5: Concise JSX Formatting Update
The return statement for the <MyEmail> component has been refactored into a more compact, single-line structure. This change preserves the component’s functionality while reducing vertical space. However, please verify that this style aligns with your team’s coding conventions, as a more expanded format might enhance readability and ease future modifications.


8-8: Closing Tag Formatting Consistency
The closing </Html> tag is now placed on the same line as the content, which is acceptable so long as it remains consistent with the project's style guide. Ensure that this formatting choice does not hinder maintainability in larger or more complex components.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ComparisonConditionRender.tsx (1)

368-369: UI label mismatch with terminology.

While all the type definitions have been updated to use "selector" terminology, this UI label still uses "Filter group" which is inconsistent with the new naming convention.

-                Filter group
+                Selector group
apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/Overview.tsx (1)

45-46: Inconsistent parameter naming: "filter" should be "selector"

For consistency with the terminology change throughout the codebase, the parameter name should be updated from "filter" to "selector".

-const getFinalSelector = (filter: DeploymentVersionCondition | null) =>
-  filter && !isEmptyCondition(filter) ? filter : undefined;
+const getFinalSelector = (selector: DeploymentVersionCondition | null) =>
+  selector && !isEmptyCondition(selector) ? selector : undefined;
apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/providers/page.tsx (2)

124-128: Type usage updated but variable naming inconsistency exists.

The type usage has been correctly updated from ResourceFilterType.Provider to ResourceSelectorType.Provider. However, the variable is still named filter while the type has been renamed to include "Selector". Consider renaming the variable for consistency.

-    const filter: ResourceCondition = {
+    const selector: ResourceCondition = {
      type: ResourceSelectorType.Provider,
      value: provider.id,
      operator: "equals",
    };

130-132: URL parameter naming inconsistency.

While type names have been updated from "filter" to "selector", the URL parameter is still named "filter". Consider updating the URL parameter name for complete terminology consistency across the application.

-    const filterLink = `/${workspaceSlug}/resources/list?filter=${hash}`;
+    const selectorLink = `/${workspaceSlug}/resources/list?selector=${hash}`;
-    return { ...provider, filterLink };
+    return { ...provider, selectorLink };

However, if backward compatibility with existing URLs is required, this might be intentional.

packages/job-dispatch/src/resource/dispatch-resource.ts (4)

160-181: Consider renaming function to match new terminology

The function name getNotInSystemFilter should be updated to getNotInSystemSelector to maintain consistency with the terminology change from "filter" to "selector" throughout the codebase.

-const getNotInSystemFilter = async (
+const getNotInSystemSelector = async (
  systemId: string,
): Promise<ResourceCondition | null> => {

203-203: Update variable name to match new terminology

The variable name notInSystemFilter should be renamed to notInSystemSelector to maintain consistency with the terminology change.

-  const notInSystemFilter = await getNotInSystemFilter(systemId);
+  const notInSystemSelector = await getNotInSystemFilter(systemId);

If you also rename the function as suggested in the previous comment, make sure to update the function call as well:

-  const notInSystemSelector = await getNotInSystemFilter(systemId);
+  const notInSystemSelector = await getNotInSystemSelector(systemId);

204-207: Update variable reference to match new terminology

After renaming the variable, make sure to update this condition check to use the new variable name.

-  if (notInSystemFilter == null) {
+  if (notInSystemSelector == null) {
    log.warn("No system found for environment", { envId });
    return;
  }

210-213: Update variable reference in resourceMatchesMetadata call

Update the parameter passed to SCHEMA.resourceMatchesMetadata to use the renamed variable.

  const isRemovedFromSystem = SCHEMA.resourceMatchesMetadata(
    db,
-    notInSystemFilter,
+    notInSystemSelector,
  );
apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/TableRow.tsx (1)

262-266: Verify usage of filter variable name

The variable name filter is still being used here despite the PR renaming filter to selector throughout the codebase. Consider renaming this variable to selector for consistency.

  const filter: JobCondition = {
    type: SelectorType.Comparison,
    operator: ComparisonOperator.And,
    conditions: [isSameRelease, isSameResource, isSameEnvironment],
  };

  const { data: releaseJobTriggers } =
    api.job.config.byWorkspaceId.list.useQuery(
-      { workspaceId: workspace?.id ?? "", filter },
+      { workspaceId: workspace?.id ?? "", selector: filter },
      { enabled: workspace != null },
    );

Alternatively, if the API parameter is still named filter:

- const filter: JobCondition = {
+ const selector: JobCondition = {
    type: SelectorType.Comparison,
    operator: ComparisonOperator.And,
    conditions: [isSameRelease, isSameResource, isSameEnvironment],
  };

  const { data: releaseJobTriggers } =
    api.job.config.byWorkspaceId.list.useQuery(
-      { workspaceId: workspace?.id ?? "", filter },
+      { workspaceId: workspace?.id ?? "", filter: selector },
      { enabled: workspace != null },
    );
packages/api/src/router/deployment-variable.ts (1)

179-190: getOldResourceSelector logic.
This function merges multiple resource selectors or returns a single one if it's not the default. The approach is clear and valid.

Consider factoring out common logic for a more concise structure, but the current setup is functional.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment/drawer/Filter.tsx (1)

199-211: Refactoring getFilter to wrap single conditions.
The function ensures a top-level comparison structure (ComparisonOperator.And) if the provided condition is not already comparison-based.

Consider renaming getFilter to something like ensureComparisonCondition for clearer intent.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/policies/TargetFilterUniquenessIndicator.tsx (2)

102-107: User-facing message still references 'filter'

While the component variables have been renamed to use 'selector', the user-facing message still references "resource filter". This should be updated for consistency.

- Please add a resource filter to select resources for this environment.
+ Please add a resource selector to select resources for this environment.

182-184: User-facing message still references 'filters'

The explanatory text still mentions "resource filters" which should be updated to "resource selectors" for consistency with the rest of the changes.

- This may happen if you added new resources that match multiple resource filters.
+ This may happen if you added new resources that match multiple resource selectors.
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/CreateDeploymentVersionChannelDialog.tsx (1)

167-169: Button text updated but icon name remains

The button text has been updated from "Edit filter" to "Edit selector", but the icon is still named IconFilter. Consider also updating the icon name for complete consistency, although this would require changes to the import statement as well.

If you'd like to maintain perfect consistency, you could consider one of:

  1. Importing and using an alternate icon like IconAdjustments instead of IconFilter
  2. Or, keeping the current icon but renaming the local reference for clarity:
-<IconFilter className="h-4 w-4" />
+<IconFilter className="h-4 w-4" /* This represents a selector icon */ />
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableEnvironmentInput.tsx (1)

57-57:

❓ Verification inconclusive

Prop name may need grammatical review

The prop name has been changed from shouldFilter to shouldSelector, but this doesn't maintain grammatical correctness. Consider a prop name like enableSelection or shouldSelect instead.

-<Command shouldSelector={false}>
+<Command shouldSelect={false}>

Alternatively, ensure the component's API is consistent with other components that may have been renamed in this PR.


🏁 Script executed:

#!/bin/bash
# Find other usages of shouldSelector/shouldFilter in the codebase
echo "Checking for other usages of shouldSelector in the codebase:"
rg -i "shouldSelector" --type tsx

echo "Checking for other usages of shouldFilter in the codebase:"
rg -i "shouldFilter" --type tsx

echo "Checking the Command component definition to understand the prop name:"
rg -A 10 -B 10 "shouldSelector.*?:" --type tsx

Length of output: 607


Below is a revised review comment. Note that because the initial search commands failed to locate usages due to the file type flag, please re-run the verification using the updated commands (see script below) to ensure there aren’t any other locations using the old or new prop name unexpectedly.


Action Required: Revisit the Prop Naming for Consistency & Grammar

  • The prop was renamed from shouldFilter to shouldSelector, which doesn’t read naturally. A clearer alternative would be using a name such as shouldSelect (or even enableSelection if that better fits the component’s API).
  • Confirm that this rename aligns with similar components in the codebase to maintain consistency in the API design.
  • Suggested diff snippet:
    -<Command shouldSelector={false}>
    +<Command shouldSelect={false}>

Please re-verify the following with these updated search commands to confirm no additional instances need updating:


🏁 Script executed:

#!/bin/bash
echo "Searching for other usages of shouldSelector in .tsx files:"
rg -i "shouldSelector" -g "*.tsx"

echo "Searching for other usages of shouldFilter in .tsx files:"
rg -i "shouldFilter" -g "*.tsx"

echo "Inspecting the Command component definition for the prop usage:"
rg -A 15 -B 15 "shouldSelector.*?:" -g "*.tsx"

Length of output: 2063


Action required: Unify and Clarify the Command Prop Naming

We observed that in this file the Command component is using the prop shouldSelector, whereas several other files still use shouldFilter. The term shouldSelector isn’t grammatically intuitive. For clarity and consistency, consider renaming the prop to shouldSelect (or possibly enableSelection, if that better reflects the intended functionality).

For example:

-<Command shouldSelector={false}>
+<Command shouldSelect={false}>

Additionally, please review all instances of the Command component—such as those in JobResourceConditionRender.tsx and various Variable*Input.tsx files—to ensure that the prop naming is consistent across the codebase.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/ConfigFields.tsx (1)

291-292: Inconsistent terminology in button text.

While all property references have been changed from filter to selector, the button text still says "Edit Filter". For consistency, consider updating this text as well.

- <Button variant="outline">Edit Filter</Button>
+ <Button variant="outline">Edit Selector</Button>
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (1)

58-58: Simplify the destructuring assignment

The current destructuring uses a redundant rename.

-const { resourceSelector: resourceSelector } = form.watch();
+const { resourceSelector } = form.watch();
🧰 Tools
🪛 Biome (1.9.4)

[error] 58-58: Useless rename.

Safe fix: Remove the renaming.

(lint/complexity/noUselessRename)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a72568 and 121f9c5.

📒 Files selected for processing (96)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/jobs/release-table/ResourceReleaseTable.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/DeploymentVersionEnvironmentCell.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/JobHistoryPopover.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/TableCells.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/CreateDeploymentVersionChannelDialog.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/DeploymentResourcesDialog.tsx (5 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/EditDeploymentSection.tsx (7 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/ConfigFields.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableDeploymentInput.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableEnvironmentInput.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableResourceInput.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableTable.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableValueDropdown.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/page.tsx (5 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/variable-data.ts (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/ResourcesPageContent.tsx (14 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_components/EditSelector.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useFilteredResources.ts (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/deployments/TableDeployments.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/environments/EnvironmentRow.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/policies/TargetFilterUniquenessIndicator.tsx (5 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/_components/variables/VariableResourceInput.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/create/RunbookVariableEditor.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/SystemsPageContent.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/_components/system-deployment-table/TableDeployments.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/Overview.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/DeploymentResourceDrawer.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/TableRow.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment/drawer/Filter.tsx (5 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobComparisonConditionRender.tsx (12 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobResourceConditionRender.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/RunbookJobComparisonConditionRender.tsx (8 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ComparisonConditionRender.tsx (13 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ResourceViewActionsDropdown.tsx (4 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceSelector.ts (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/channel/useDeploymentVersionChannel.ts (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useFilter.ts (0 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useSelector.ts (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/insights/DailyJobsChart.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/SidebarKinds.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/providers/page.tsx (2 hunks)
  • apps/webservice/src/app/api/v1/deployments/openapi.ts (1 hunks)
  • apps/webservice/src/app/api/v1/environments/openapi.ts (1 hunks)
  • apps/webservice/src/app/api/v1/openapi.ts (1 hunks)
  • apps/webservice/src/app/api/v1/release-channels/openapi.ts (2 hunks)
  • apps/webservice/src/app/api/v1/release-channels/route.ts (2 hunks)
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/openapi.ts (3 hunks)
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/route.ts (1 hunks)
  • apps/webservice/src/app/terminal/_components/CreateDialogSession.tsx (1 hunks)
  • openapi.v1.json (6 hunks)
  • packages/api/src/router/deployment-variable.ts (9 hunks)
  • packages/api/src/router/deployment-version.ts (3 hunks)
  • packages/api/src/router/deployment.ts (2 hunks)
  • packages/api/src/router/environment-page/deployments/deployment-stats.ts (2 hunks)
  • packages/api/src/router/environment-page/overview/deployment-stats.ts (2 hunks)
  • packages/api/src/router/environment-page/overview/router.ts (4 hunks)
  • packages/api/src/router/environment-page/resources/router.ts (2 hunks)
  • packages/api/src/router/environment-stats.ts (2 hunks)
  • packages/api/src/router/environment.ts (4 hunks)
  • packages/api/src/router/resource-stats.ts (1 hunks)
  • packages/api/src/router/resource-views.ts (1 hunks)
  • packages/api/src/router/resources.ts (3 hunks)
  • packages/api/src/router/system.ts (2 hunks)
  • packages/db/drizzle/0079_mute_cerise.sql (1 hunks)
  • packages/db/drizzle/meta/_journal.json (1 hunks)
  • packages/db/src/schema/deployment-variables.ts (2 hunks)
  • packages/db/src/schema/deployment.ts (2 hunks)
  • packages/db/src/schema/environment.ts (2 hunks)
  • packages/db/src/schema/job.ts (3 hunks)
  • packages/db/src/schema/resource.ts (3 hunks)
  • packages/emails/src/Welcome.jsx (1 hunks)
  • packages/emails/src/client/env.js (1 hunks)
  • packages/emails/src/client/index.js (1 hunks)
  • packages/emails/tailwind.config.js (1 hunks)
  • packages/job-dispatch/src/__test__/job-variables-deployment.test.ts (8 hunks)
  • packages/job-dispatch/src/deployment-update.ts (5 hunks)
  • packages/job-dispatch/src/environment-creation.ts (2 hunks)
  • packages/job-dispatch/src/environment-release-channel-update.ts (2 hunks)
  • packages/job-dispatch/src/events/triggers/deployment-removed.ts (1 hunks)
  • packages/job-dispatch/src/events/triggers/environment-deleted.ts (2 hunks)
  • packages/job-dispatch/src/events/triggers/resource-deleted.ts (2 hunks)
  • packages/job-dispatch/src/job-variables-deployment/job-variables-deployment.ts (1 hunks)
  • packages/job-dispatch/src/job-variables-deployment/utils.ts (2 hunks)
  • packages/job-dispatch/src/policies/release-sequencing.ts (2 hunks)
  • packages/job-dispatch/src/release-job-trigger.ts (2 hunks)
  • packages/job-dispatch/src/resource/dispatch-resource.ts (2 hunks)
  • packages/job-dispatch/src/resource/utils.ts (1 hunks)
  • packages/node-sdk/src/schema.ts (2 hunks)
  • packages/validators/src/conditions/index.ts (1 hunks)
  • packages/validators/src/jobs/conditions/job-condition.ts (3 hunks)
  • packages/validators/src/resources/conditions/resource-condition.ts (5 hunks)
💤 Files with no reviewable changes (1)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useFilter.ts
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{ts,tsx}`: **Note on Error Handling:** Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error...

**/*.{ts,tsx}: Note on Error Handling:
Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error handling. These are acceptable as long as they maintain clarity and predictability.

  • packages/job-dispatch/src/job-variables-deployment/job-variables-deployment.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/CreateDeploymentVersionChannelDialog.tsx
  • packages/api/src/router/resource-views.ts
  • apps/webservice/src/app/terminal/_components/CreateDialogSession.tsx
  • packages/api/src/router/environment-stats.ts
  • packages/api/src/router/resource-stats.ts
  • packages/job-dispatch/src/__test__/job-variables-deployment.test.ts
  • packages/api/src/router/environment-page/resources/router.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableDeploymentInput.tsx
  • packages/api/src/router/environment-page/overview/deployment-stats.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/channel/useDeploymentVersionChannel.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_components/EditSelector.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableEnvironmentInput.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/environments/EnvironmentRow.tsx
  • apps/webservice/src/app/api/v1/environments/openapi.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/JobHistoryPopover.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobResourceConditionRender.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/Overview.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/_components/variables/VariableResourceInput.tsx
  • apps/webservice/src/app/api/v1/openapi.ts
  • packages/validators/src/resources/conditions/resource-condition.ts
  • apps/webservice/src/app/api/v1/release-channels/route.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/_components/system-deployment-table/TableDeployments.tsx
  • packages/db/src/schema/deployment-variables.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ResourceViewActionsDropdown.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ComparisonConditionRender.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/variable-data.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/DeploymentVersionEnvironmentCell.tsx
  • packages/job-dispatch/src/resource/dispatch-resource.ts
  • packages/db/src/schema/environment.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/create/RunbookVariableEditor.tsx
  • packages/job-dispatch/src/job-variables-deployment/utils.ts
  • packages/validators/src/conditions/index.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/ConfigFields.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx
  • packages/job-dispatch/src/policies/release-sequencing.ts
  • apps/webservice/src/app/api/v1/deployments/openapi.ts
  • packages/validators/src/jobs/conditions/job-condition.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useFilteredResources.ts
  • packages/api/src/router/deployment-version.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableResourceInput.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/RunbookJobComparisonConditionRender.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/SidebarKinds.tsx
  • apps/webservice/src/app/api/v1/release-channels/openapi.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx
  • packages/api/src/router/environment.ts
  • packages/node-sdk/src/schema.ts
  • packages/job-dispatch/src/resource/utils.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/DeploymentResourceDrawer.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/TableRow.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/page.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobComparisonConditionRender.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/deployments/TableDeployments.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useSelector.ts
  • packages/api/src/router/deployment-variable.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/providers/page.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/TableCells.tsx
  • packages/job-dispatch/src/environment-release-channel-update.ts
  • packages/job-dispatch/src/events/triggers/deployment-removed.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceSelector.ts
  • packages/job-dispatch/src/environment-creation.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/jobs/release-table/ResourceReleaseTable.tsx
  • packages/api/src/router/deployment.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/DeploymentResourcesDialog.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableValueDropdown.tsx
  • packages/api/src/router/system.ts
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/route.ts
  • packages/api/src/router/environment-page/overview/router.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/EditDeploymentSection.tsx
  • packages/db/src/schema/deployment.ts
  • packages/api/src/router/resources.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/policies/TargetFilterUniquenessIndicator.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/SystemsPageContent.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableTable.tsx
  • packages/job-dispatch/src/release-job-trigger.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/ResourcesPageContent.tsx
  • packages/db/src/schema/job.ts
  • packages/job-dispatch/src/events/triggers/resource-deleted.ts
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/openapi.ts
  • packages/job-dispatch/src/events/triggers/environment-deleted.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/insights/DailyJobsChart.tsx
  • packages/db/src/schema/resource.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx
  • packages/job-dispatch/src/deployment-update.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment/drawer/Filter.tsx
  • packages/api/src/router/environment-page/deployments/deployment-stats.ts
🧬 Code Definitions (30)
packages/api/src/router/environment-stats.ts (1)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
packages/api/src/router/resource-stats.ts (1)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
packages/api/src/router/environment-page/resources/router.ts (1)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
packages/api/src/router/environment-page/overview/deployment-stats.ts (1)
packages/db/src/schema/deployment.ts (1)
  • deployment (61-85)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_components/EditSelector.tsx (2)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • resourceCondition (38-48)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/environments/EnvironmentRow.tsx (1)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/JobHistoryPopover.tsx (1)
packages/validators/src/jobs/conditions/job-condition.ts (1)
  • JobCondition (30-39)
packages/validators/src/resources/conditions/resource-condition.ts (6)
packages/validators/src/releases/conditions/release-condition.ts (2)
  • isCreatedAtCondition (91-94)
  • isVersionCondition (86-89)
packages/validators/src/jobs/conditions/job-condition.ts (2)
  • isCreatedAtCondition (79-81)
  • isVersionCondition (97-99)
packages/validators/src/conditions/date-condition.ts (1)
  • CreatedAtCondition (37-37)
packages/validators/src/resources/conditions/last-sync-condition.ts (1)
  • LastSyncCondition (11-11)
packages/validators/src/conditions/index.ts (1)
  • VersionCondition (40-40)
packages/validators/src/resources/conditions/version-condition.ts (1)
  • VersionCondition (9-9)
packages/db/src/schema/deployment-variables.ts (1)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • resourceCondition (38-48)
apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ResourceViewActionsDropdown.tsx (2)
apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceSelector.ts (1)
  • useResourceSelector (9-72)
packages/db/src/schema/resource.ts (1)
  • ResourceView (141-141)
packages/db/src/schema/environment.ts (1)
packages/validators/src/resources/conditions/resource-condition.ts (2)
  • resourceCondition (38-48)
  • isValidResourceCondition (139-158)
apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx (1)
packages/validators/src/jobs/conditions/job-condition.ts (1)
  • JobCondition (30-39)
packages/validators/src/jobs/conditions/job-condition.ts (4)
packages/validators/src/resources/conditions/resource-condition.ts (4)
  • isComparisonCondition (76-79)
  • isMetadataCondition (102-105)
  • isCreatedAtCondition (125-127)
  • isVersionCondition (134-137)
packages/validators/src/releases/conditions/release-condition.ts (4)
  • isComparisonCondition (58-61)
  • isMetadataCondition (81-84)
  • isCreatedAtCondition (91-94)
  • isVersionCondition (86-89)
packages/validators/src/conditions/metadata-condition.ts (1)
  • MetadataCondition (56-56)
packages/validators/src/conditions/index.ts (1)
  • VersionCondition (40-40)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useFilteredResources.ts (1)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • ResourceCondition (27-36)
packages/api/src/router/deployment-version.ts (2)
packages/validators/src/cac/index.ts (1)
  • version (3-7)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • ResourceCondition (27-36)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableResourceInput.tsx (1)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • ResourceCondition (27-36)
apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx (1)
apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceSelector.ts (1)
  • useResourceSelector (9-72)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/TableCells.tsx (1)
packages/validators/src/jobs/conditions/job-condition.ts (1)
  • JobCondition (30-39)
packages/job-dispatch/src/events/triggers/deployment-removed.ts (2)
packages/db/src/schema/deployment.ts (2)
  • deployment (61-85)
  • Deployment (97-97)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • ResourceCondition (27-36)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (2)
packages/validators/src/resources/conditions/resource-condition.ts (3)
  • ResourceCondition (27-36)
  • isComparisonCondition (76-79)
  • resourceCondition (38-48)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/DeploymentResourcesDialog.tsx (1)
packages/validators/src/resources/conditions/resource-condition.ts (2)
  • ResourceCondition (27-36)
  • isValidResourceCondition (139-158)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableValueDropdown.tsx (1)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • resourceCondition (38-48)
packages/api/src/router/environment-page/overview/router.ts (3)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • ResourceCondition (27-36)
packages/db/src/schema/deployment.ts (1)
  • deployment (61-85)
packages/db/src/schema/deployment.ts (1)
packages/validators/src/resources/conditions/resource-condition.ts (2)
  • resourceCondition (38-48)
  • isValidResourceCondition (139-158)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/ResourcesPageContent.tsx (2)
packages/validators/src/resources/conditions/resource-condition.ts (1)
  • ResourceCondition (27-36)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
packages/db/src/schema/job.ts (3)
packages/db/src/schema/deployment-version.ts (1)
  • deploymentVersion (105-130)
packages/db/src/schema/release-job-trigger.ts (1)
  • releaseJobTrigger (24-50)
packages/db/src/schema/resource.ts (1)
  • resource (58-86)
packages/db/src/schema/resource.ts (1)
packages/validators/src/resources/conditions/resource-condition.ts (2)
  • ResourceCondition (27-36)
  • resourceCondition (38-48)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx (2)
packages/db/src/schema/job.ts (1)
  • JobStatus (132-132)
packages/validators/src/jobs/conditions/job-condition.ts (1)
  • JobCondition (30-39)
apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment/drawer/Filter.tsx (4)
packages/db/src/schema/resource.ts (1)
  • resourceView (131-139)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
packages/validators/src/resources/conditions/resource-condition.ts (2)
  • ResourceCondition (27-36)
  • isComparisonCondition (76-79)
packages/validators/src/jobs/conditions/job-condition.ts (1)
  • isComparisonCondition (71-73)
packages/api/src/router/environment-page/deployments/deployment-stats.ts (2)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
packages/db/src/schema/deployment.ts (1)
  • deployment (61-85)
🪛 Biome (1.9.4)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts

[error] 58-58: Useless rename.

Safe fix: Remove the renaming.

(lint/complexity/noUselessRename)

🪛 GitHub Check: Lint
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/jobs/release-table/ResourceReleaseTable.tsx

[failure] 474-474:
'setSelector' is assigned a value but never used. Allowed unused vars must match /^_/u

🪛 GitHub Actions: CI
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx

[error] 108-108: Unnecessary conditional, value is always falsy @typescript-eslint/no-unnecessary-condition

🔇 Additional comments (299)
packages/validators/src/conditions/index.ts (1)

22-22: Naming update looks good!

The renaming of FilterType to SelectorType aligns with the PR objective to standardize terminology across the codebase. This change maintains the same enum values while improving naming consistency.

apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/SidebarKinds.tsx (4)

18-19: Consistent terminology change from Filter to Selector.

The renamed import from FilterType to SelectorType aligns with the PR's objective of standardizing terminology across the codebase.


20-20: Consistent terminology change from ResourceFilterType to ResourceSelectorType.

The import statement update maintains consistency with the project-wide terminology change from "filter" to "selector".


42-43: Updated filter type to selector type in the filter URL.

The JSON object property now uses SelectorType.Comparison instead of FilterType.Comparison, keeping the same functionality while adopting the new terminology.


45-49: Updated conditions type from ResourceFilterType to ResourceSelectorType.

The condition's type has been properly changed to use the new ResourceSelectorType.Kind enum value while maintaining the same functionality.

packages/api/src/router/deployment.ts (2)

505-505: LGTM, property name update is consistent with PR objectives.

The change from resourceFilter to resourceSelector aligns with the overall terminology refactoring in this PR.


530-531: LGTM, function parameter update is correct.

The parameter passed to SCHEMA.resourceMatchesMetadata has been properly updated from resourceFilter to resourceSelector, maintaining consistency with the schema changes while preserving the original functionality.

packages/emails/src/client/env.js (2)

4-11: Formatting and Consistency Improvement

The restructuring of the server object improves readability without altering the configuration logic. Each SMTP-related key now appears clearly and consistently, which helps ensure maintainability.


12-15: Improved Readability for Runtime Environment and Validation Flags

The updated formatting for runtimeEnv and skipValidation makes the code easier to read and understand. The inline boolean coercion (using !!) is clear, and the use of logical OR for the skipValidation flag is well-arranged.

packages/emails/src/Welcome.jsx (1)

1-11: Overall Component Verification
The component’s logic and exports remain unchanged, and the updated JSX formatting does not affect functionality. This change is cosmetic and fits within the broader refactoring effort. No issues were detected with the component's structure or behavior.

apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/channel/useDeploymentVersionChannel.ts (2)

7-7: Import renamed correctly from FilterType to SelectorType.

The import has been updated to use SelectorType instead of FilterType, which is consistent with the PR's goal of renaming filter terminology to selector throughout the codebase.


36-36: Type reference updated properly to SelectorType.Comparison.

The type property in the selector object has been correctly updated to use SelectorType.Comparison instead of FilterType.Comparison, maintaining functionality while adhering to the new terminology.

packages/api/src/router/resource-views.ts (1)

97-97: LGTM: Consistent terminology update from filter to selector.

This change aligns with the PR objective of refactoring "filter" to "selector" across the codebase. The business logic remains unchanged while ensuring consistent terminology.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ComparisonConditionRender.tsx (3)

36-37: Import changes look good.

The renamed imports (SelectorType instead of FilterType and ResourceSelectorType instead of ResourceFilterType) follow the terminology standardization from "filter" to "selector" as outlined in the PR description.

Also applies to: 41-42


82-83: Type adjustments in comparison condition creation are correct.

The type property has been properly updated to use ResourceSelectorType.Comparison instead of ResourceFilterType.Comparison in both comparison condition creation scenarios.

Also applies to: 117-118


271-275: Dropdown menu condition types updated consistently.

All condition type definitions in the dropdown menu items have been correctly updated from their respective filter types to selector types, maintaining consistency throughout the UI.

Also applies to: 283-287, 294-298, 305-309, 316-320, 327-331, 338-342, 349-353, 361-366, 375-380

packages/api/src/router/resources.ts (3)

75-88: Parameter rename looks good

The change from resourceFilter to resourceSelector in the environmentHasResource function signature and usage is implemented correctly, maintaining the same ResourceCondition type. This is consistent with the PR's objective of standardizing terminology.


175-175: Consistent variable rename

The hasFilter variable now correctly checks for the presence of resourceSelector instead of resourceFilter, maintaining the same functionality while using the updated terminology.


205-207: Filter condition rename properly implemented

The renaming from resourceFilter to resourceSelector in both the filter condition and in the function call to environmentHasResource is correctly implemented, ensuring consistency throughout the codebase.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/Overview.tsx (2)

24-26: Import renamed correctly from FilterType to SelectorType.

The import has been properly updated as part of the filter-to-selector terminology change.


81-86: Usage correctly updated to SelectorType.Comparison.

The type usage has been properly changed from FilterType.Comparison to SelectorType.Comparison in the getVersionSelector function.

apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/providers/page.tsx (1)

40-40: Type import updated correctly.

The import has been correctly changed from ResourceFilterType to ResourceSelectorType, which aligns with the PR objective of systematically updating terminology from "filter" to "selector" across the codebase.

packages/validators/src/jobs/conditions/job-condition.ts (5)

17-17: Import renamed from FilterType to SelectorType - good!

The import has been properly updated to reflect the new naming convention, maintaining consistency with the PR objective.


54-54: SelectorType.Comparison correctly replaces FilterType.Comparison

The defaultCondition type property has been properly updated to use SelectorType.Comparison. This change is consistent with the updated naming convention.


60-66: Enum renamed from JobFilterType to JobSelectorType

The enum has been correctly renamed while preserving all its values, ensuring a clean terminology transition without changing the underlying functionality.


69-69: Updated condition type checks from FilterType to SelectorType

All SelectorType condition checks (Comparison, Metadata, CreatedAt, and Version) have been updated properly. This maintains consistency with the other changes in the PR.

Also applies to: 73-73, 77-77, 81-81, 99-99


85-85: Updated job-specific condition checks to use JobSelectorType

All job-specific condition checks (Status, Environment, Deployment, JobResource) have been properly updated to use JobSelectorType. These changes are consistent with the renaming pattern across the codebase.

Also applies to: 90-90, 95-95, 104-104

packages/api/src/router/environment.ts (6)

38-38: Good import rename from FilterType to SelectorType

This rename aligns with the project's goal of updating filter terminology to selector terminology throughout the codebase, starting with the imported types.


256-263: Consistent variable and condition renaming

The changes from resourceFilter to resourceSelector and isUpdatingResourceFilter to isUpdatingResourceSelector are consistent with the project's terminology update. The logic remains identical while making the naming more consistent.


265-268: Properly updated condition blocks

The condition variable has been appropriately renamed from hasResourceFiltersChanged to hasResourceSelectorsChanged while maintaining the same functional logic. The corresponding null check has also been updated.


275-277: Correctly updated array mapping

The mapping from environments to their corresponding selectors has been updated with the new field name while preserving the existing filtering logic.


279-283: Function parameters properly updated

The parameters passed to resourceMatchesMetadata have been consistently renamed from filter to selector, maintaining the original functionality.


313-318: Type update for ResourceCondition

The type for the sysFilter object has been properly updated from FilterType.Comparison to SelectorType.Comparison, maintaining type safety while adopting the new terminology.

packages/job-dispatch/src/resource/dispatch-resource.ts (4)

17-17: LGTM: Import statement updated correctly

The import statement has been correctly updated from ResourceFilterType to ResourceSelectorType.


163-163: LGTM: Schema reference updated correctly

The schema reference has been correctly updated from SCHEMA.environment.resourceFilter to SCHEMA.environment.resourceSelector.


170-172: LGTM: Environment mapping updated correctly

The mapping from environment properties has been correctly updated from e.resourceFilter to e.resourceSelector.


175-180: LGTM: Return type updated correctly

The return type in the object literal has been correctly updated from ResourceFilterType.Comparison to ResourceSelectorType.Comparison.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/TableRow.tsx (6)

20-20: LGTM - Type update aligned with the selector refactoring

This change correctly updates the import from FilterType to SelectorType, maintaining consistency with the PR's objective of renaming filter to selector across the codebase.


23-23: LGTM - Type update aligned with the selector refactoring

This change correctly updates the import from JobFilterType to JobSelectorType, following the PR's pattern of updating filter terminology to selector.


238-242: LGTM - Updated job condition type to use the new selector terminology

The job condition's type property has been properly updated from JobFilterType.Release to JobSelectorType.Release, maintaining the same functionality while adopting the new naming convention.


244-248: LGTM - Updated job resource condition type to use the new selector terminology

The job resource condition's type property has been properly updated from JobFilterType.JobResource to JobSelectorType.JobResource, maintaining consistent terminology.


250-254: LGTM - Updated environment condition type to use the new selector terminology

The environment condition's type property has been properly updated from JobFilterType.Environment to JobSelectorType.Environment, following the pattern of renaming filter to selector.


256-260: LGTM - Updated comparison type to use the new selector terminology

The filter object's type property has been properly updated from FilterType.Comparison to SelectorType.Comparison, maintaining the same functionality while using the new naming convention.

packages/api/src/router/system.ts (3)

32-32: Import renaming looks good

The import has been properly updated from FilterType to SelectorType, which aligns with the PR objective of standardizing terminology across the codebase.


231-232: Database field reference updated correctly

The check for non-null resource selector has been properly updated from environment.resourceFilter to environment.resourceSelector.


236-239:

✅ Verification successful

Resource condition structure updated correctly

The code has been properly updated to use the new terminology:

  1. type: SelectorType.Comparison instead of FilterType.Comparison
  2. Mapping to env.resourceSelector instead of env.resourceFilter

These changes maintain consistency with the PR's renaming objective.

Please verify that the database schema has been updated to match these changes, specifically ensuring that the resourceFilter column in the environment table has been renamed to resourceSelector.


🏁 Script executed:

#!/bin/bash
# Search for database schema definitions or migrations that would show the column rename
rg -A 5 -B 5 "resourceSelector|resourceFilter" --type ts

Length of output: 65595


Database Schema Update Verified

The database schema has been correctly updated. The environment table now defines the column as resourceSelector (see, for example, in packages/db/src/schema/environment.ts where the column is declared as resourceSelector: jsonb("resource_selector")), ensuring consistency with the PR’s renaming changes. The code in packages/api/src/router/system.ts correctly maps to env.resourceSelector and aligns with these schema updates.

packages/api/src/router/environment-stats.ts (2)

38-38: Properly renamed resourceFilter to resourceSelector in null check.

This change correctly updates the null check to use the new property name, maintaining consistency with the database schema changes shown in the relevant code snippets.


92-92: Correctly updated function argument to use resourceSelector.

The argument to SCHEMA.resourceMatchesMetadata has been properly updated to use the new property name resourceSelector instead of resourceFilter, ensuring consistency with the database schema.

packages/db/drizzle/meta/_journal.json (1)

557-564: Migration entry for the filter-to-selector renaming looks good

The added journal entry reflects a new database migration for renaming "filter" to "selector", which aligns with the broader terminology change throughout the codebase.

packages/api/src/router/resource-stats.ts (2)

168-168: Variable name updated consistently from resourceFilter to resourceSelector

The null check has been properly updated to reference the renamed field, maintaining the same functionality.


173-173: Parameter name updated consistently in function call

The parameter passed to SCHEMA.resourceMatchesMetadata has been properly updated from resourceFilter to resourceSelector.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/environments/EnvironmentRow.tsx (2)

36-36: Query parameter name updated correctly

The filter parameter now correctly uses environment.resourceSelector instead of resourceFilter, maintaining consistency with the database schema changes.


39-39: Query enabled condition updated properly

The condition to enable the query now correctly checks if environment.resourceSelector is not null, matching the renamed field.

apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useSelector.ts (1)

1-41: Well-implemented useSelector hook replacing useFilter

This new hook is a clean implementation that manages the selector state from URL parameters. The hook properly handles:

  1. Reading and parsing the selector from URL
  2. Error handling for malformed data
  3. Writing the selector back to URL in compressed format
  4. Clearing the selector when set to null

The implementation aligns with the project's transition from "filter" to "selector" terminology.

packages/job-dispatch/src/environment-release-channel-update.ts (3)

8-8: Import statement correctly updated to use SelectorType.

The import has been properly updated to use SelectorType instead of FilterType, aligning with the PR objective to rename filter to selector.


37-37: Type property correctly updated.

Successfully updated from FilterType.Comparison to SelectorType.Comparison while maintaining the same functionality.


45-45: Multiple type properties correctly updated.

Both instances of FilterType.Comparison have been properly changed to SelectorType.Comparison in the nested condition structures, maintaining consistent terminology throughout.

Also applies to: 49-49

apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/DeploymentResourceDrawer.tsx (3)

15-15: Import statements correctly updated.

Imports have been properly updated from FilterType to SelectorType and JobFilterType to JobSelectorType, aligning with the PR objective.

Also applies to: 17-17


55-55: Job filter type property correctly updated.

The type property in the jobFilter object has been successfully updated from FilterType.Comparison to SelectorType.Comparison.


59-59: Job filter condition types correctly updated.

All condition type properties have been successfully updated from JobFilterType to JobSelectorType while maintaining the same functionality for job resource, environment, and deployment conditions.

Also applies to: 64-64, 69-69

apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobResourceConditionRender.tsx (4)

22-22: Import statements correctly updated.

Imports have been properly updated from FilterType to SelectorType and ResourceFilterType to ResourceSelectorType, aligning with the PR objective.

Also applies to: 24-24


49-49: Search filter type property correctly updated.

The type property in the searchFilter object has been successfully updated from ResourceFilterType.Name to ResourceSelectorType.Name.


60-60: Resource property name correctly updated.

The property accessed from the environment object has been updated from resourceFilter to resourceSelector in the envFilters array mapping.


64-64: System filter type properties correctly updated.

Both instances of FilterType.Comparison have been properly changed to SelectorType.Comparison in the system filter objects, maintaining consistent terminology.

Also applies to: 72-72

packages/job-dispatch/src/release-job-trigger.ts (3)

87-87: Schema property name correctly updated.

The check for isNotNull(SCHEMA.environment.resourceFilter) has been properly updated to isNotNull(SCHEMA.environment.resourceSelector).


141-142: Destructuring properties correctly updated.

The destructured properties have been updated from resourceFilter to resourceSelector for both environment and deployment objects. Note that the variable name deploymentResourceFilter is maintained for the second property despite using resourceSelector in the schema.


149-149: Schema method parameter correctly updated.

The parameter passed to SCHEMA.resourceMatchesMetadata has been updated from resourceFilter to resourceSelector, maintaining consistent terminology.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceSelector.ts (5)

9-9: Function name updated to match the selector terminology.

The hook has been renamed from useResourceFilter to useResourceSelector, which aligns with the broader terminology change in the codebase.


14-14: Variable renamed for consistency.

The URL parameter variable has been updated from filterHash to selectorHash to maintain consistent terminology.


16-18: Updated conditional check to use new parameter name.

The null check and JSON parsing now correctly reference the renamed selectorHash parameter.


22-22: Updated dependency array with new variable name.

The dependency array in the useMemo hook has been updated to reference selectorHash.


71-71: Updated return value to use selector terminology.

The function now returns setSelector instead of setFilter in the object, completing the naming transition.

packages/job-dispatch/src/job-variables-deployment/utils.ts (3)

78-78: Parameter name changed to reflect selector terminology.

The function parameter has been updated from resourceFilter to resourceSelector to maintain consistent terminology across the codebase.


86-86: Updated parameter name in schema function call.

The call to SCHEMA.resourceMatchesMetadata now correctly passes the renamed parameter.


99-99: Updated function call with renamed parameter.

The function call to getMatchedResource now uses the renamed parameter resourceSelector, maintaining consistency.

packages/job-dispatch/src/resource/utils.ts (2)

79-79: Field renamed to match selector terminology.

The field in the select statement has been updated from resourceFilter to resourceSelector to align with the schema changes.


87-87: Updated field reference in condition check.

The isNotNull check now correctly references the renamed field schema.environment.resourceSelector.

packages/db/src/schema/deployment-variables.ts (2)

63-65: Database column renamed to use selector terminology.

The database column has been updated from resourceFilter to resourceSelector, maintaining the same type and default value configuration.


82-82: Updated schema validation to use renamed field.

The Zod schema validation in createDeploymentVariableValue has been updated to reference the renamed field.

packages/job-dispatch/src/events/triggers/resource-deleted.ts (4)

9-9: Import update looks good

The import has been correctly updated from ResourceFilterType to ResourceSelectorType as part of the standardization of terminology from "filter" to "selector".


21-21: Property name change is consistent

Query correctly updated to check for non-null resourceSelector instead of resourceFilter.


28-29: Mapping selector properties correctly

The mapping function now properly uses e.resourceSelector instead of e.resourceFilter, maintaining the same functionality while adopting the new terminology.


32-33: Type update is consistent with new naming convention

Changed from ResourceFilterType.Comparison to ResourceSelectorType.Comparison correctly, maintaining type safety.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/_components/system-deployment-table/TableDeployments.tsx (4)

21-22: Import update is consistent

Import has been correctly changed from FilterType to SelectorType in line with the terminology standardization.


34-35: EnvHeader component correctly updated

The property reference has been changed from env.resourceFilter to env.resourceSelector without altering the component's functionality.


69-71: Variable renaming in DirectoryHeader component

Both the variable name resourceSelectors and the property access env.resourceSelector have been updated consistently.


73-79: Filter construction logic updated correctly

The condition check and object construction have been properly updated to use the new terminology:

  1. Check for resourceSelectors.length instead of resourceFilters.length
  2. Type set to SelectorType.Comparison instead of FilterType.Comparison
  3. Conditions property references resourceSelectors instead of resourceFilters

All changes maintain the same business logic.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/RunbookJobComparisonConditionRender.tsx (7)

38-39: Import statements correctly updated

Both imports have been properly renamed:

  • FilterTypeSelectorType
  • JobFilterTypeJobSelectorType

This ensures type safety is maintained while implementing the new terminology.

Also applies to: 44-46


85-88: Type update in convertToComparison function

The comparison condition type has been correctly updated to SelectorType.Comparison.


120-124: Type update in convertToNotComparison function

The not comparison condition type has been correctly updated to SelectorType.Comparison.


279-284: Metadata condition type update

The metadata condition type in the dropdown menu item handler has been correctly updated to SelectorType.Metadata.


291-295: CreatedAt condition type update

The created at condition type in the dropdown menu item handler has been correctly updated to SelectorType.CreatedAt.


302-306: Job status condition type update

The job status condition type has been correctly updated to JobSelectorType.Status.


314-319: Comparison group condition types update

Both filter group and not group condition types have been correctly updated to SelectorType.Comparison while maintaining the same functionality.

Also applies to: 328-333

packages/db/src/schema/environment.ts (2)

60-62: Database schema field renamed correctly

The database column has been properly renamed from resourceFilter to resourceSelector while maintaining the same JSONB type and NULL default value.


79-81: Schema validation update

The createEnvironment schema has been correctly updated to use resourceSelector instead of resourceFilter, including the refinement function parameter rename from filter to selector.

This maintains the same validation logic where the value must either be null or a valid resource condition.

packages/db/src/schema/deployment.ts (2)

55-58: LGTM! Consistent renaming from filter to selector.

The renaming of resourceFilter to resourceSelector in the schema definition and the refinement function parameter is consistent with the PR objectives. The validation logic remains unchanged, preserving the same behavior while updating terminology.


80-82: LGTM! Database schema field renamed appropriately.

The database field has been renamed from resource_filter to resource_selector while maintaining the same type definition and default value. This change is consistent with the schema definition update above.

packages/job-dispatch/src/environment-creation.ts (2)

17-18: LGTM! Variable renaming properly implemented.

The destructuring and null check for resourceSelector (previously resourceFilter) have been updated consistently. The conditional logic remains unchanged, maintaining the same behavior.


45-45: LGTM! Function parameter updated correctly.

The function call to SCHEMA.resourceMatchesMetadata now correctly passes resourceSelector instead of resourceFilter, completing the renaming in this file.

packages/job-dispatch/src/events/triggers/deployment-removed.ts (4)

9-9: LGTM! Import statement updated correctly.

The import has been changed from ResourceFilterType to ResourceSelectorType, aligning with the type renaming in the validators package.


15-15: LGTM! Schema reference updated properly.

The check for non-null filters now correctly references SCHEMA.environment.resourceSelector instead of resourceFilter.


23-24: LGTM! Variable mapping updated consistently.

The environment mapping now correctly extracts resourceSelector properties instead of resourceFilter properties.


27-31: LGTM! Enum reference updated appropriately.

The systemFilter object now correctly uses ResourceSelectorType.Comparison instead of ResourceFilterType.Comparison.

packages/validators/src/resources/conditions/resource-condition.ts (12)

15-18: LGTM! Imports updated correctly.

The import has been updated to use SelectorType instead of FilterType, maintaining consistency with the broader renaming effort.


58-67: LGTM! Enum renamed correctly.

The ResourceFilterType enum has been renamed to ResourceSelectorType while maintaining all the same values and structure.


69-74: LGTM! Default condition updated properly.

The default condition now correctly uses ResourceSelectorType.Comparison instead of ResourceFilterType.Comparison.


76-79: LGTM! Type check updated correctly.

The isComparisonCondition function now correctly compares against ResourceSelectorType.Comparison.


102-105: LGTM! Type check updated properly.

The isMetadataCondition function now correctly compares against ResourceSelectorType.Metadata.


107-109: LGTM! Type check updated properly.

The isKindCondition function now correctly compares against ResourceSelectorType.Kind.


111-113: LGTM! Type check updated properly.

The isNameCondition function now correctly compares against ResourceSelectorType.Name.


115-118: LGTM! Type check updated properly.

The isProviderCondition function now correctly compares against ResourceSelectorType.Provider.


120-123: LGTM! Type check updated properly.

The isIdentifierCondition function now correctly compares against ResourceSelectorType.Identifier.


125-127: LGTM! Type check remains consistent.

The isCreatedAtCondition function is correctly using SelectorType.CreatedAt from the imported conditions module.


129-132: LGTM! Type check updated properly.

The isLastSyncCondition function now correctly compares against ResourceSelectorType.LastSync.


134-137: LGTM! Type check updated properly.

The isVersionCondition function now correctly compares against ResourceSelectorType.Version.

packages/db/src/schema/job.ts (3)

42-45: Type imports updated to use Selector terminology

The imports have been properly updated to reflect the new naming convention, changing from FilterType to SelectorType and JobFilterType to JobSelectorType.


254-267: Consistent renaming in buildCondition function

The buildCondition function has been successfully updated to use the new selector terminology throughout all conditional branches. The logic itself remains unchanged, preserving the functionality while enhancing naming consistency.


275-293: Consistent renaming in buildRunbookCondition function

All type checks in the buildRunbookCondition function have been correctly updated to use the new SelectorType and JobSelectorType terminology. The conditional logic remains intact while maintaining naming consistency.

packages/job-dispatch/src/deployment-update.ts (6)

10-12: Updated import to use SelectorType

Import statement has been correctly modified to use SelectorType instead of FilterType.


46-56: Resource selector references updated in environment query

References to resourceFilter have been properly updated to resourceSelector in both the variable naming and in the environment data access.


60-64: SystemFilter definition updated to use SelectorType

The systemFilter object now correctly uses SelectorType.Comparison instead of FilterType.Comparison.


111-115: isInSystem object updated to use SelectorType

The isInSystem condition object now uses SelectorType.Comparison and correctly maps environments to their resourceSelector property.


117-127: Resource filter objects updated to use SelectorType

Both oldResourcesFilter and newResourcesFilter objects have been correctly updated to use SelectorType.Comparison and reference the new resourceSelector properties.


195-202: Updated equality check for deployment resource selector

The comparison logic now correctly checks resourceSelector properties instead of resourceFilter properties, maintaining consistency with the renamed schema fields.

packages/api/src/router/deployment-version.ts (4)

32-34: Updated SelectorType import

Import statement has been correctly modified to use SelectorType instead of FilterType.


795-800: Updated resourceSelector check

The condition check for the existence of a resource filter has been correctly modified to check env.environment.resourceSelector instead of resourceFilter.


802-809: Updated resourceSelector object creation

The resourceSelector condition object now correctly uses SelectorType.Comparison and properly references the renamed resourceSelector properties from both environment and deployment objects.


817-818: Updated resource matching function call

The resource metadata matching function is now correctly called with the renamed resourceSelector parameter.

packages/api/src/router/environment-page/deployments/deployment-stats.ts (2)

9-11: Updated SelectorType import

Import statement has been correctly modified to use SelectorType instead of FilterType.


108-114: Updated resourceSelector object creation

The resourceSelector object in the getDeploymentStats function now correctly uses SelectorType.Comparison and references the renamed resourceSelector properties from both environment and deployment objects.

packages/api/src/router/deployment-variable.ts (8)

42-42: Renaming from FilterType to SelectorType.
This aligns with the overall rename across the codebase. Implementation looks good.


122-122: Consistency with environment.resourceSelector.
This change from environment.resourceFilter to environment.resourceSelector fosters coherent naming across the environment references. Looks good.


130-132: Switching to SelectorType.Comparison and mapping resourceSelector.
Adopting SelectorType.Comparison along with .map((e) => e.resourceSelector) is consistent with the new naming approach.


192-204: getNewResourceSelector logic.
Similar to getOldResourceSelector, it conditionally composes the default or an individual resource selector. The approach is straightforward.


205-215: Constructing final old/new resource selectors.
Combining systemCondition with the old/new resource selectors ensures environment-scoped matching is maintained.


219-219: Using oldResourceSelector in resourceMatchesMetadata.
This correct reference aligns with the rename from filter to selector.


226-226: Using newResourceSelector in resourceMatchesMetadata.
Again, the consistent transition from filter to selector maintains clarity.


290-290: Updated comment referencing deploymentVariableValueResourceSelector.
No functional issues. This clarifies the new naming in comments.

packages/db/src/schema/resource.ts (4)

44-49: Renaming references to SelectorType and ResourceSelectorType.
These changes match the broader naming refactor across the project.


138-139: Replacing filter column with selector.
Renaming to selector in resource_view is consistent with the updated terminology.


144-144: Applying resourceCondition to selector.
Ensures the selector field in createResourceView is validated by the correct schema.


290-305: Condition checks updated to ResourceSelectorType & SelectorType.CreatedAt.
These lines reflect the move from filter-based to selector-based condition types. However, there's a mix of ResourceSelectorType.* and SelectorType.CreatedAt.

Please verify that CreatedAt belongs under SelectorType instead of ResourceSelectorType for full consistency.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment/drawer/Filter.tsx (4)

27-27: Renaming to SelectorType.
The new import aligns with the broader rename from filter to selector across the codebase.


42-42: Passing resourceView.selector in onChange.
Consistently uses the updated selector property, maintaining clarity.


105-105: Initializing form defaults with environment.resourceSelector.
This ensures the form is populated properly after the rename from resourceFilter.


121-121: Updating mutation data to use resourceSelector.
Maintains consistency with the server-side environment schema.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/policies/TargetFilterUniquenessIndicator.tsx (6)

23-27: Function renaming looks good

The function name change from useResourceFilterUniqueness to useResourceSelectorUniqueness is consistent with the overall PR objective of renaming "filter" to "selector".


35-37: Query key update is appropriate

The query key elements have been properly updated to reference the new property name.


47-49: Condition references properly updated

The resourceSelector references in the conditions array have been correctly updated.


54-56: Enabled condition properly updated

The query enabled check has been correctly updated to check for the resourceSelector property.


93-98: Component renaming looks good

The export name has been updated from ResourceFilterUniquenessIndicator to ResourceSelectorUniquenessIndicator, which aligns with the PR's renaming goal.


151-153: Updated data references in link generation

The references to resourceSelector in the link generation logic have been properly updated.

packages/job-dispatch/src/events/triggers/environment-deleted.ts (6)

9-9: Import has been properly updated

The import statement has been correctly updated to reference ResourceSelectorType instead of ResourceFilterType.


14-14: Null check updated appropriately

The null check has been properly updated to reference the new property name resourceSelector.


20-21: Function parameter updated correctly

The call to SCHEMA.resourceMatchesMetadata has been updated to pass environment.resourceSelector instead of environment.resourceFilter.


27-28: Schema condition check updated

The isNotNull check has been correctly updated to reference SCHEMA.environment.resourceSelector.


36-38: Map reference updated correctly

The mapping operation now properly references e.resourceSelector instead of e.resourceFilter.


40-45: Type reference updated in variable declaration

The constant declaration has been updated to use ResourceSelectorType.Comparison instead of ResourceFilterType.Comparison.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableDeploymentInput.tsx (1)

57-57: Prop name updated from shouldFilter to shouldSelector

The property name has been correctly updated from shouldFilter to shouldSelector in the Command component, which aligns with the PR's objective of standardizing terminology from "filter" to "selector" across the codebase.

apps/webservice/src/app/terminal/_components/CreateDialogSession.tsx (1)

51-55: Property name changed from filter to selector

The property name has been correctly updated from filter to selector in the API query parameters. This change is consistent with the PR's objective of updating terminology throughout the codebase.

apps/webservice/src/app/api/v1/openapi.ts (1)

195-199: API schema property renamed from resourceFilter to resourceSelector

The property name has been successfully updated in the Environment schema definition from resourceFilter to resourceSelector while maintaining the same structure and type information. This change aligns with the PR's goal of standardizing terminology across the codebase.

apps/webservice/src/app/api/v1/environments/openapi.ts (1)

37-40: API request schema property renamed from resourceFilter to resourceSelector

The property name has been correctly updated in the environment creation request body schema from resourceFilter to resourceSelector. This change ensures consistency with the other schema changes and aligns with the terminology standardization objective of the PR.

packages/emails/tailwind.config.js (1)

3-18: Indentation consistency looks good.

The configuration is properly structured with consistent indentation, making it more readable. All properties (content, presets, theme) maintain their original values and functionality.

packages/job-dispatch/src/__test__/job-variables-deployment.test.ts (1)

89-89: Consistent renaming from "resourceFilter" to "resourceSelector".

All instances of resourceFilter have been properly renamed to resourceSelector in the test environment objects, maintaining consistency with the broader refactoring effort across the codebase.

Also applies to: 95-95, 101-101, 252-252, 322-322, 389-389, 456-456, 523-523, 620-620, 717-717

packages/api/src/router/environment-page/resources/router.ts (2)

11-11: Import statement updated from FilterType to SelectorType.

The import statement has been correctly updated to use SelectorType instead of FilterType, aligning with the terminology change throughout the codebase.


48-53: Updated resource condition type and property references.

The code correctly:

  1. Uses SelectorType.Comparison instead of FilterType.Comparison
  2. References environment.resourceSelector instead of environment.resourceFilter

These changes align with the database schema where the field is defined as resourceSelector.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_components/EditSelector.tsx (2)

23-24: Updated mutation data property from resourceFilter to resourceSelector.

The mutation data object property has been correctly updated to use resourceSelector instead of resourceFilter, ensuring the proper field is updated in the database.


29-30: Updated component prop from resourceFilter to resourceSelector.

The condition prop passed to the ResourceConditionDialog component has been correctly updated to reference environment.resourceSelector instead of environment.resourceFilter, maintaining consistency with the renamed field.

packages/api/src/router/environment-page/overview/deployment-stats.ts (2)

48-48: Consistent rename from filter to selector

The change from deployment.resourceFilter to deployment.resourceSelector aligns with the schema definition in packages/db/src/schema/deployment.ts where the field is defined as resourceSelector. This maintains consistency with the broader PR objective of renaming "filter" to "selector" throughout the codebase.


76-76: Consistent renaming in WHERE clause

Good job consistently updating the second instance of deployment.resourceFilter to deployment.resourceSelector in this WHERE clause. Ensuring all references are updated prevents potential runtime errors.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/TableCells.tsx (4)

34-35: Import update from FilterType to SelectorType

The import change from FilterType to SelectorType maintains the consistent renaming pattern across the codebase.


38-38: Import update from JobFilterType to JobSelectorType

The import change from JobFilterType to JobSelectorType correctly implements the renaming pattern.


147-150: Updated JobSelectorType in condition

The change from JobFilterType.Release to JobSelectorType.Release correctly implements the type renaming.


153-156: Updated JobSelectorType for environment condition

The change from JobFilterType.Environment to JobSelectorType.Environment correctly implements the type renaming.

apps/webservice/src/app/api/v1/release-channels/route.ts (2)

14-16: Schema updated with releaseSelector property

The schema has been updated to use releaseSelector instead of releaseFilter which aligns with the renaming pattern throughout the codebase.


29-29: Backwards compatibility for property access

Good implementation of backwards compatibility by handling both body.versionSelector and body.releaseSelector. This allows for a smoother transition and prevents breaking changes for existing API consumers.

apps/webservice/src/app/api/v1/deployments/openapi.ts (1)

64-67: Updated OpenAPI specification property name and description

The OpenAPI specification has been updated to use resourceSelector instead of resourceFilter and the description has been updated accordingly. This ensures that the API documentation remains consistent with the implementation.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/variable-data.ts (1)

6-6: LGTM: Renamed property to align with new terminology

The property renaming from filterHash to selectorHash is consistent with the broader terminology change from "filter" to "selector" across the codebase.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/_components/variables/VariableResourceInput.tsx (1)

21-23: LGTM: Import renamed correctly

The import has been correctly updated from ResourceFilterType to ResourceSelectorType.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableTable.tsx (2)

72-72: LGTM: Input placeholder text updated correctly

The placeholder text has been appropriately updated from "Filter variables..." to "Selector variables..." in line with the terminology changes.


269-269: LGTM: URL parameter updated correctly

The URL parameter has been correctly updated from using filter=${v.filterHash} to selector=${v.selectorHash}.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/JobHistoryPopover.tsx (3)

8-8: Import updates align with terminology changes.

The import change from JobFilterType to JobSelectorType aligns with the PR objective of renaming "filter" to "selector" across the codebase.


28-32: Variable and type renamed correctly.

The renaming of inDeploymentFilter to inDeploymentSelector and updating the type to JobSelectorType.Deployment maintains consistency with the new terminology while preserving the original functionality.


45-45: Prop reference updated correctly.

The baseFilter prop now correctly references the renamed inDeploymentSelector variable, ensuring consistency throughout the component while maintaining the same behavior.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/create/RunbookVariableEditor.tsx (1)

56-58: Variable renaming maintains consistency while preserving logic.

The variable has been correctly renamed from isResourceFilterChanged to isResourceSelectorChanged, and its usage in the conditional check has been updated accordingly. This change aligns with the PR's objective of standardizing terminology from "filter" to "selector" while maintaining the exact same functionality.

Note that the property names mergedConfig.filter and config.filter remain unchanged, which is likely due to these properties being defined in types or interfaces not visible in this file.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ResourceViewActionsDropdown.tsx (4)

28-28: Import statement updated correctly.

The import has been properly updated to use useResourceSelector instead of useResourceFilter, aligning with the PR's standardization of terminology.


37-37: Function destructuring renamed correctly.

The destructured function has been renamed from setFilter to setSelector to maintain consistency with the new hook naming convention.


66-66: Function call updated appropriately.

The function call has been updated to use setSelector(null, null) instead of setFilter(null, null), maintaining the same functionality while using the new terminology.


85-86: Hook and function references properly renamed.

Both the hook destructuring and the function that uses it have been updated to reflect the new terminology. The property access on line 86 has also been updated from v.filter to v.selector, ensuring consistency with the database schema changes.

packages/db/drizzle/0079_mute_cerise.sql (1)

1-4: Database migration script correctly renames columns.

This SQL migration script appropriately renames all filter-related columns to use "selector" terminology across multiple tables:

  1. resource_filterresource_selector in deployment_variable_value table
  2. resource_filterresource_selector in deployment table
  3. resource_filterresource_selector in environment table
  4. filterselector in resource_view table

These changes are essential to ensure database schema consistency with the updated frontend terminology.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/ConfigFields.tsx (2)

278-282: Function renamed for consistency but logic remains unchanged.

The onFilterChange function has been renamed to onSelectorChange, and all references to filter within the function have been updated to selector. This aligns with the terminology shift from "filter" to "selector" across the codebase.


286-290: Condition references updated consistently.

The JSX code has been properly updated to use selector instead of filter for the condition display and dialog.

apps/webservice/src/app/api/v1/release-channels/openapi.ts (3)

20-20: Updated required fields in schema.

The required field has been properly updated from releaseFilter to releaseSelector, maintaining schema integrity while aligning with the new terminology.


25-28: API schema property renamed.

The property in the request body schema has been renamed from releaseFilter to releaseSelector, maintaining the same type definition and additional properties configuration.


47-50: Response schema property renamed.

The property in the response schema has been renamed from releaseFilter to releaseSelector, maintaining consistency with the request schema changes.

apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx (2)

34-34: Imported hook renamed.

The import has been updated from useResourceFilter to useResourceSelector, aligning with the terminology change.


86-86: Updated hook destructuring.

The destructured values from the hook have been updated from { filter, setFilter } to { filter, setSelector }, reflecting the new hook's interface.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useFilteredResources.ts (3)

11-11: Updated JSDoc parameter description.

The JSDoc comment has been updated to reflect the parameter rename from filter to selector, maintaining documentation accuracy.


17-17: Function parameter renamed.

The parameter has been renamed from filter to selector while preserving the same type (ResourceCondition | null), ensuring the function signature remains correct.


22-22: Query parameter renamed in API call.

The API query parameter has been updated from filter to selector, ensuring the hook correctly passes the renamed parameter to the API call.

apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/route.ts (4)

22-22: Terminology update in route handler parameter looks good

The parameter type has been updated to use selector instead of filter, maintaining consistency with the new terminology.


25-31: JSON parsing and validation updated correctly

All references to filter have been properly renamed to selector in the parsing and validation logic, maintaining the same functionality while using the new terminology.


33-33: Variable renaming looks good

Variable renaming from filter to selector is consistent with the terminology update.


41-41: Database query parameter updated correctly

The SCHEMA.resourceMatchesMetadata function now correctly uses selector instead of filter.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/DeploymentVersionEnvironmentCell.tsx (3)

15-15: Import renamed from FilterType to SelectorType

The import has been correctly updated to use the new terminology.


51-61: Resource condition logic updated with new terminology

All occurrences of filter have been properly renamed to selector in this code block:

  1. Variable declaration and type
  2. Property checks for environment.resourceSelector and deployment.resourceSelector
  3. Type definition updated to SelectorType.Comparison

These changes maintain the original functionality while using the new terminology.


65-66: API query parameters updated correctly

The query parameters and the enabled condition now correctly use selector instead of filter, maintaining the functionality while updating the terminology.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (5)

10-10: Import renamed from FilterType to SelectorType

The import statement has been correctly updated to use the new terminology.


19-31: getSelector function updated with new terminology

All occurrences of filter have been properly renamed to selector in the getSelector function:

  1. Function parameter renamed to resourceSelector
  2. Type definition updated to SelectorType.Comparison
  3. Return statement and condition checks updated

These changes maintain the original functionality while using the new terminology.


34-34: Form schema field renamed correctly

The form schema field has been properly renamed from resourceFilter to resourceSelector.


54-54: Form default values updated correctly

The default values in the form initialization now correctly reference resourceSelector instead of resourceFilter.


63-63: Mutation data field renamed correctly

The mutation's data field has been properly renamed from resourceFilter to resourceSelector.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableValueDropdown.tsx (4)

61-65: Form schema field renamed correctly

The editVariableValueFormSchema has been updated to use resourceSelector instead of resourceFilter, maintaining the same validation rules while using the new terminology.


151-151: Form field name updated correctly

The FormField component's name prop has been updated from resourceFilter to resourceSelector.


154-154: Form label text updated correctly

The label text has been updated from "Resource filter" to "Resource selector" to maintain terminology consistency.


185-188: Button action and text updated correctly

The button that clears the selector value has been updated:

  1. The form value setter targets resourceSelector instead of resourceFilter
  2. Button text changed from "Clear filter" to "Clear selector"

These changes maintain the original functionality while using the new terminology.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/page.tsx (3)

52-58: LGTM! Consistent renaming of filter to selector.

The variable systemResourcesSelector and its type ResourceSelectorType.Comparison are correctly named, following the PR objective to rename all "filter" references to "selector".


67-77: Renaming is applied correctly to null checks and hash generation.

The change from resourceFilter to resourceSelector is consistently applied in both the null check and the hash generation code.


102-119: LGTM! Consistently renamed rest filters and updated condition types.

The renaming from resourceFilter to resourceSelector is consistently applied in variable naming and the ResourceSelectorType is correctly used in the condition objects.

packages/node-sdk/src/schema.ts (2)

1713-1715: LGTM! Property name updated in request body.

The property has been correctly renamed from releaseFilter to releaseSelector in the createReleaseChannel request body schema.


1733-1735: LGTM! Property name updated in response body.

The property has been correctly renamed from releaseFilter to releaseSelector in the createReleaseChannel response body schema.

packages/api/src/router/environment-page/overview/router.ts (4)

10-12: LGTM! Import renamed from FilterType to SelectorType.

The import has been updated to use the new naming convention.


46-46: LGTM! Null check renamed for consistency.

The null check on environment.resourceSelector is consistent with the renaming strategy.


66-66: LGTM! Function parameter renamed for consistency.

The parameter to SCHEMA.resourceMatchesMetadata has been updated to use the new property name.


128-137: LGTM! ResourceCondition creation updated with new naming.

The ResourceCondition creation now uses SelectorType instead of FilterType and correctly references the renamed properties: environment.resourceSelector and deployment.resourceSelector.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/deployments/TableDeployments.tsx (3)

14-16: LGTM! Import renamed from FilterType to SelectorType.

The import has been updated to use the new naming convention.


46-46: LGTM! Property access renamed for consistency.

The property access has been updated from resourceFilter to resourceSelector.


84-93: LGTM! Variable names and condition type updated.

All references have been renamed from filter to selector:

  • Variable renamed from resourceFilters to resourceSelectors
  • Property access changed from resourceFilter to resourceSelector
  • Type changed from FilterType.Comparison to SelectorType.Comparison
  • Condition array correctly uses resourceSelectors
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/jobs/release-table/ResourceReleaseTable.tsx (2)

40-40: Import statement updated correctly.

The import statement has been properly updated from useFilter to useSelector to align with the terminology change from "filter" to "selector".


476-476: Query parameter updated correctly.

The parameter name has been properly updated from filter to selector to align with the terminology change.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx (4)

38-38: Import statement updated correctly.

The import has been properly updated from FilterType to SelectorType to align with the terminology change.


65-72: Variable and type names updated consistently.

The variable names have been properly updated from resourceFilter to resourceSelector, and the condition type has been changed from FilterType.Comparison to SelectorType.Comparison for consistency.


75-76: Query parameters updated correctly.

The parameter name has been properly updated from filter to selector to align with the terminology change, including the enabled condition check.


108-117: Directory header variable and type names updated consistently.

The variable names have been properly updated from filter-related to selector-related terms, and the condition type has been changed consistently for directories as well.

apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/openapi.ts (3)

7-10: OpenAPI path and operation details updated consistently.

The endpoint path has been correctly updated from resources/{filter} to resources/{selector}. The summary and operationId have also been properly updated to reflect the terminology change.


20-25: Parameter name and description updated consistently.

The parameter name has been properly updated from filter to selector, and its description has been updated accordingly.


40-40: Error description updated consistently.

The error description has been properly updated from "Invalid filter" to "Invalid selector" to align with the terminology change.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableResourceInput.tsx (5)

21-23: Import statement updated correctly.

The import has been properly updated from ResourceFilterType to ResourceSelectorType to align with the terminology change.


32-33: Parameter name updated correctly.

The parameter name has been properly updated from existingFilter to existingSelector to align with the terminology change.


39-49: Variable name and type updated, but condition structure remains consistent.

The variable name has been properly updated from filter to selector, and the type has been updated to use ResourceSelectorType.Comparison instead of ResourceFilterType.Comparison.


57-58: Return value name updated correctly.

The return value has been properly updated from filter to selector to align with the terminology change.


66-70: Variable name in destructured object updated correctly.

The variable name in the destructured object has been properly updated from filter to selector to align with the terminology change.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobComparisonConditionRender.tsx (13)

36-38: Consistent type renaming from Filter to Selector.

The import statement has been updated to use SelectorType instead of FilterType, aligning with the refactoring goal of changing terminology from "filter" to "selector" throughout the codebase.


42-44: Type import renamed from JobFilterType to JobSelectorType.

The import has been correctly updated to use the new naming convention, maintaining consistency with the other type changes.


83-87: Condition type updated to use SelectorType.

The comparison condition type value has been updated from FilterType.Comparison to SelectorType.Comparison, which is consistent with the imports and overall refactoring approach.


118-123: Updated comparison condition type to SelectorType.

The not comparison condition type has been correctly updated to use SelectorType.Comparison instead of FilterType.Comparison.


277-282: Updated metadata condition type to SelectorType.

The metadata condition creation uses the new SelectorType.Metadata type, maintaining consistency with the refactoring pattern.


289-293: Updated CreatedAt condition type to SelectorType.

The date condition creation now uses SelectorType.CreatedAt instead of FilterType.CreatedAt.


300-304: Updated job status condition type to JobSelectorType.

The job status condition has been updated to use JobSelectorType.Status instead of JobFilterType.Status.


311-315: Updated job resource condition type to JobSelectorType.

The job resource condition has been updated to use JobSelectorType.JobResource instead of JobFilterType.JobResource.


322-326: Updated deployment condition type to JobSelectorType.

The deployment condition has been updated to use JobSelectorType.Deployment instead of JobFilterType.Deployment.


333-337: Updated environment condition type to JobSelectorType.

The environment condition has been updated to use JobSelectorType.Environment instead of JobFilterType.Environment.


344-348: Updated version condition type to SelectorType.

The version condition has been updated to use SelectorType.Version instead of FilterType.Version.


356-361: Updated filter group condition type to SelectorType.

The filter group condition has been updated to use SelectorType.Comparison instead of FilterType.Comparison.


370-375: Updated not group condition type to SelectorType.

The not group condition has been updated to use SelectorType.Comparison instead of FilterType.Comparison.

openapi.v1.json (4)

398-404: Updated resourceFilter to resourceSelector in deployment creation schema.

The API schema now uses resourceSelector instead of resourceFilter in the deployment creation endpoint, including updating the description to match. This maintains consistency with the terminology changes throughout the codebase.


568-571: Updated resourceFilter to resourceSelector in environment schema.

The environment schema has been updated to use resourceSelector instead of resourceFilter, maintaining consistency with the terminology changes.


1261-1277: Updated releaseFilter to releaseSelector in release channel schema.

The release channel creation schema now uses releaseSelector instead of releaseFilter, maintaining consistency with the terminology changes.


1308-1311: Updated releaseFilter to releaseSelector in response schema.

The response schema for release channel creation has been updated to use releaseSelector instead of releaseFilter.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/EditDeploymentSection.tsx (8)

96-97: Updated success message key to resourceSelector.

The success message state now uses resourceSelector instead of resourceFilter to maintain consistency with the refactoring changes.


99-102: Updated environment filter references to selector.

The environment filtering logic now uses resourceSelector instead of resourceFilter, maintaining consistency with the refactoring changes.


104-109: Updated resourceFilter variables to resourceSelector.

The variable and default values have been updated to use resourceSelector instead of resourceFilter, maintaining consistency with the refactoring changes.


130-140: Updated form submission logic to use selector terminology.

The form submission logic now uses selector instead of filter variables, and updates the deployment with resourceSelector instead of resourceFilter.


171-172: Updated watched form field to resourceSelector.

The form field watch variable has been updated to use watchResourceSelector instead of watchResourceFilter.


183-185: Updated dirty check variable to resourceSelectorDirty.

The dirty check for the resource selector has been updated to use resourceSelectorDirty instead of resourceFilterDirty.


399-400: Updated form field name to resourceSelector.

The form field name has been updated to use resourceSelector instead of resourceFilter.


441-445: Updated save button functionality for resourceSelector.

The save button's onClick handler and disabled state now reference resourceSelector instead of resourceFilter, and the success message has been updated accordingly.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/DeploymentResourcesDialog.tsx (8)

24-25: Updated import from FilterType to SelectorType.

The import statement has been updated to use SelectorType instead of FilterType, maintaining consistency with the refactoring.


35-36: Updated Environment type to use resourceSelector.

The Environment type now uses resourceSelector instead of resourceFilter, maintaining consistency with the refactoring.


38-41: Updated props type to use resourceSelector.

The DeploymentResourcesDialogProps type now uses resourceSelector instead of resourceFilter.


45-55: Updated component implementation to use selector terminology.

The component implementation now uses resourceSelector instead of resourceFilter for props, and the internal variable has been renamed from filter to selector with the type updated to SelectorType.Comparison.


56-61: Updated validity check and query to use selector terminology.

The validity check now uses isSelectorValid instead of isFilterValid, and the query to the API now uses selector instead of filter.


74-75: Updated button disabled state to check resourceSelector.

The button's disabled state now checks the validity of resourceSelector instead of resourceFilter.


83-85: Updated dialog description to use selector terminology.

The dialog description now refers to "deployment selector" instead of "deployment filter", maintaining consistency with the refactoring.


109-115: Updated condition rendering and resource list to use selector.

The rendering of the resource condition and resource list now use the selector variable instead of filter.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/ResourcesPageContent.tsx (9)

41-41: LGTM: Consistent type renaming in imports

The type imports have been updated from filter-related types to selector-related types, which aligns with the PR's goal of standardizing terminology.

Also applies to: 44-44


80-94: Function renamed correctly with maintained behavior

The function parseResourceSelector (previously parseResourceFilter) maintains the same logic while using the updated terminology.


96-138: LGTM: Function maintains logic with updated type references

The function has been updated to use ResourceSelectorType and SelectorType instead of their filter counterparts, while maintaining the same logic and behavior.


140-180: Search functionality properly updated with new selector terminology

The search functionality continues to work as expected with the updated naming convention, using ResourceSelectorType.Name instead of ResourceFilterType.Name.


189-190: LGTM: Environmental resource selector integration

The code correctly uses environment.resourceSelector instead of environment.resourceFilter and constructs the final filter using SelectorType.Comparison.

Also applies to: 215-219


229-239: Filter dropdown handler updated properly

The handler function now works with ResourceSelectorType instead of ResourceFilterType while maintaining the same functionality.


259-259: Conditional check correctly updated

The null check has been properly updated to use environment.resourceSelector instead of environment.resourceFilter.


371-372: LGTM: ResourceConditionDialog onChange handler updated

The change handler now correctly uses parseResourceSelector instead of parseResourceFilter.


386-387: Dropdown value change handlers properly updated

The dropdown handlers are correctly using ResourceSelectorType enums instead of ResourceFilterType enums.

Also applies to: 399-400, 418-419

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx (5)

23-25: LGTM: Updated import statements correctly

Import statements have been properly modified to use SelectorType instead of FilterType and JobSelectorType instead of JobFilterType.


48-49: Type references updated consistently in condition objects

All condition type references have been properly updated to use JobSelectorType instead of JobFilterType.

Also applies to: 54-55, 60-61, 66-67


72-76: LGTM: Comparison condition type updated

The comparison condition now correctly uses SelectorType.Comparison instead of FilterType.Comparison.


78-88: Variable names and types updated properly

The variable names and types have been consistently updated from filter terminology to selector terminology.


93-94: API query parameters renamed correctly

The API query parameters have been updated from filter to selector to match the backend changes.

Also applies to: 102-103

apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx (1)

61-66:

❓ Verification inconclusive

Remaining "filter" references should be updated to "selector"

For consistency with the type system changes, the variable and parameter names should also be updated:

-  const filter = getFilter(resourceId, stats.id);
+  const selector = getSelector(resourceId, stats.id);

   const { data, isLoading } = api.job.config.byWorkspaceId.list.useQuery(
-    { workspaceId, filter, limit: 1 },
+    { workspaceId, selector, limit: 1 },
     { refetchInterval: 5_000 },
   );

Note: This change assumes the API parameter has also been updated to accept selector instead of filter in other files. Verify this is the case across the codebase.


Below is a shell script to verify whether the new naming (i.e. using “selector” instead of “filter”) has been applied consistently. In particular, it searches for usages of the new function name and API query calls that include “selector”:

Once these commands return output confirming that:
• A function called getSelector exists and is used in place of getFilter
• The API query calls now pass a parameter named selector instead of filter

…please update the review comment as follows:


Update 'filter' References to 'selector' for API Consistency

In apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx, update the variable and parameter names from filter to selector to keep consistent with the type system changes. Specifically:

  • Change:
      -  const filter = getFilter(resourceId, stats.id);
      -  
      -  const { data, isLoading } = api.job.config.byWorkspaceId.list.useQuery(
      -    { workspaceId, filter, limit: 1 },
      -    { refetchInterval: 5_000 },
      -  );
  • To:
      +  const selector = getSelector(resourceId, stats.id);
      +  
      +  const { data, isLoading } = api.job.config.byWorkspaceId.list.useQuery(
      +    { workspaceId, selector, limit: 1 },
      +    { refetchInterval: 5_000 },
      +  );

Action Required:
• Verify that the API has been updated across the codebase to accept the selector parameter instead of filter.
• Confirm that all references to the old filter naming are replaced accordingly.


Once confirmed via the shell script outputs, you can proceed with this update.


🏁 Script executed:

#!/bin/bash
echo "Searching for references to getSelector across the codebase..."
rg "getSelector" -n .

echo "Searching for API queries using 'selector' as a parameter..."
rg "useQuery.*selector" -n .

Length of output: 861


Below is an additional script to check the usage of the old “filter” references specifically within the file in question. Please run these commands and verify that the file still uses getFilter/filter rather than the new getSelector/selector:

Once you confirm that the above script returns references indicating the old naming, please update the file as follows:


Action Required: Update 'filter' References to 'selector' for Consistency

In apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx (lines 61–66), change the variable and parameter names from filter to selector to match the type system updates. For example:

-  const filter = getFilter(resourceId, stats.id);
+  const selector = getSelector(resourceId, stats.id);

-  const { data, isLoading } = api.job.config.byWorkspaceId.list.useQuery(
-    { workspaceId, filter, limit: 1 },
-    { refetchInterval: 5_000 },
-  );
+  const { data, isLoading } = api.job.config.byWorkspaceId.list.useQuery(
+    { workspaceId, selector, limit: 1 },
+    { refetchInterval: 5_000 },
+  );

Please Note:

  • A function called getSelector is already used—see for instance its usage in apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.tsx.
  • Ensure that the API’s parameter naming has been updated accordingly from filter to selector across the codebase.

Once you have verified these points, the changes in ResourceDeploymentRow.tsx can be safely made.


🏁 Script executed:

#!/bin/bash
echo "Checking for occurrences of 'getFilter' in ResourceDeploymentRow.tsx..."
rg "getFilter" -n "apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx"

echo "Checking for API query usage of 'filter' in ResourceDeploymentRow.tsx..."
rg "useQuery.*filter" -n "apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx"

Length of output: 852


Update "filter" References to "selector" for API Consistency

In apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx, the current implementation continues to use the old naming:

-  const filter = getFilter(resourceId, stats.id);
-  
-  const { data, isLoading } = api.job.config.byWorkspaceId.list.useQuery(
-    { workspaceId, filter, limit: 1 },
-    { refetchInterval: 5_000 },
-  );

Please update these lines as follows:

+  const selector = getSelector(resourceId, stats.id);
+  
+  const { data, isLoading } = api.job.config.byWorkspaceId.list.useQuery(
+    { workspaceId, selector, limit: 1 },
+    { refetchInterval: 5_000 },
+  );

Action Items:

  • Confirm that the new function getSelector is correctly implemented (see its usage in other files, e.g., in useEnvResourceEditor.tsx).
  • Verify that the API parameter has been updated to accept selector instead of filter throughout the codebase.
packages/emails/src/client/index.js (2)

4-10: Code formatting looks good.

The indentation has been consistently updated to use 4 spaces throughout the configuration object, which improves readability.


13-13: Consistent formatting applied.

The return statement's indentation has been updated to match the new 4-space standard, maintaining consistency with the rest of the file.

packages/job-dispatch/src/job-variables-deployment/job-variables-deployment.ts (1)

147-149: Successfully renamed filter to selector.

The property name has been updated from resourceFilter to resourceSelector, which aligns with the PR objective of standardizing terminology across the codebase.

packages/job-dispatch/src/policies/release-sequencing.ts (2)

92-95: Properly renamed filter to selector in query selection.

The property name has been updated from rcReleaseFilter to rcReleaseSelector in the releaseChannelSubquery, maintaining consistent terminology.


150-152: Updated property access to use new selector naming.

Updated the property access to use the renamed rcReleaseSelector property, ensuring consistency with the change made to the releaseChannelSubquery.

apps/webservice/src/app/[workspaceSlug]/(app)/insights/DailyJobsChart.tsx (3)

24-24: LGTM: Imports updated to new selector terminology.

The imports have been correctly updated from FilterType to SelectorType and from JobFilterType to JobSelectorType as part of the terminology standardization.

Also applies to: 26-26


210-210: LGTM: Condition types consistently updated.

All condition type references have been systematically updated:

  • FilterType.CreatedAtSelectorType.CreatedAt
  • JobFilterType.StatusJobSelectorType.Status
  • FilterType.ComparisonSelectorType.Comparison

This ensures consistent typing throughout the component.

Also applies to: 216-216, 222-222, 228-228, 234-234, 240-240, 251-251


58-58:

❓ Verification inconclusive

Consider updating remaining "filter" references.

While the type references have been updated, there are still instances of "filter" terminology in:

  1. The baseFilter prop name (line 58)
  2. The URL parameter filterLink and query param filter=${hash} (line 265)

For complete consistency, consider updating these as well. However, if these names are tied to API contracts or URL structures that haven't been changed, keeping them might be appropriate.

Also applies to: 265-265


🏁 Script executed:

#!/bin/bash
# Check if other components use similar URL parameters or prop names
# to determine if this is a global pattern

echo "Checking for URL query parameter usage:"
rg "filter=.*?\"" --type ts --type tsx

echo "Checking for baseFilter prop usage:"
rg "baseFilter" --type ts --type tsx

Length of output: 302


Review Update: Verify Remaining "filter" References

The type references have been updated, but some “filter” nomenclature remains that could lead to inconsistency. In particular:

  • The baseFilter prop defined at line 58.
  • The URL parameter filterLink and the query parameter filter=${hash} at line 265.

Recommendation:

  • If these usages aren’t tied to external API contracts or URL structures, update them for consistency.
  • Otherwise, if they must remain unchanged due to API dependencies, please document the rationale for retaining the legacy naming.

Please run the above script or manually verify all occurrences in the codebase to ensure no unintended side effects.


🏁 Script executed:

#!/bin/bash
# Re-run the search without file type restrictions to capture all instances.
echo "Checking for 'baseFilter' usage in DailyJobsChart.tsx:"
rg "baseFilter" apps/webservice/src/app/\[workspaceSlug\]/\(app\)/insights/DailyJobsChart.tsx

echo "Checking for 'filterLink' usage in DailyJobsChart.tsx:"
rg "filterLink" apps/webservice/src/app/\[workspaceSlug\]/\(app\)/insights/DailyJobsChart.tsx

echo "Checking for query parameter references (e.g., filter=) in DailyJobsChart.tsx:"
rg 'filter=' apps/webservice/src/app/\[workspaceSlug\]/\(app\)/insights/DailyJobsChart.tsx

Length of output: 1096


Action: Verify and Update "filter" Naming Consistency

The current implementation in apps/webservice/src/app/[workspaceSlug]/(app)/insights/DailyJobsChart.tsx still uses the term "filter" in two places:

  • Prop Name:

    • The property baseFilter?: JobCondition; is defined (line 58) and passed along as part of the component's props.
  • URL References:

    • The variable filterLink is constructed as
      const filterLink = `/${workspaceSlug}/jobs?filter=${hash}`;
      on line 265, embedding the query parameter filter=${hash} in the URL.

For complete consistency, consider updating these to match the new naming conventions if they aren’t tied to external API contracts or URL architectures. If these names are bound by contractual or backward-compatibility reasons, please document the decision to retain them.

Please manually verify this change’s impact on any API contracts or the parts of the system that might depend on the current naming before updating.

filter,
sort,
setFilter: (filter: string) => setParams({ filter }),
setFilter: (filter: string) => setParams({ selector: selector }),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the reference error in the setFilter function

There's a variable naming issue in the setFilter function. The parameter is named filter but you're attempting to use selector which is undefined.

Apply this fix:

-setFilter: (filter: string) => setParams({ selector: selector }),
+setFilter: (filter: string) => setParams({ selector: filter }),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
setFilter: (filter: string) => setParams({ selector: selector }),
setFilter: (filter: string) => setParams({ selector: filter }),

Comment on lines 30 to 48
const getFilter = (resourceId: string, deploymentId: string): JobCondition => {
const resourceFilter: JobCondition = {
type: JobFilterType.JobResource,
const resourceSelector: JobCondition = {
type: JobSelectorType.JobResource,
operator: ColumnOperator.Equals,
value: resourceId,
};

const deploymentFilter: JobCondition = {
type: JobFilterType.Deployment,
type: JobSelectorType.Deployment,
operator: ColumnOperator.Equals,
value: deploymentId,
};

return {
type: FilterType.Comparison,
type: SelectorType.Comparison,
operator: ComparisonOperator.And,
conditions: [resourceFilter, deploymentFilter],
conditions: [resourceSelector, deploymentFilter],
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Inconsistent naming: Function and variable names still use "filter" terminology

For consistency with the "filter" to "selector" renaming effort:

  1. The function getFilter should be renamed to getSelector
  2. The variable deploymentFilter on line 37 should be renamed to deploymentSelector

This ensures naming consistency with the updated type system where FilterType and JobFilterType have been renamed to SelectorType and JobSelectorType.

-const getFilter = (resourceId: string, deploymentId: string): JobCondition => {
+const getSelector = (resourceId: string, deploymentId: string): JobCondition => {
   const resourceSelector: JobCondition = {
     type: JobSelectorType.JobResource,
     operator: ColumnOperator.Equals,
     value: resourceId,
   };

-  const deploymentFilter: JobCondition = {
+  const deploymentSelector: JobCondition = {
     type: JobSelectorType.Deployment,
     operator: ColumnOperator.Equals,
     value: deploymentId,
   };

   return {
     type: SelectorType.Comparison,
     operator: ComparisonOperator.And,
-    conditions: [resourceSelector, deploymentFilter],
+    conditions: [resourceSelector, deploymentSelector],
   };
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const getFilter = (resourceId: string, deploymentId: string): JobCondition => {
const resourceFilter: JobCondition = {
type: JobFilterType.JobResource,
const resourceSelector: JobCondition = {
type: JobSelectorType.JobResource,
operator: ColumnOperator.Equals,
value: resourceId,
};
const deploymentFilter: JobCondition = {
type: JobFilterType.Deployment,
type: JobSelectorType.Deployment,
operator: ColumnOperator.Equals,
value: deploymentId,
};
return {
type: FilterType.Comparison,
type: SelectorType.Comparison,
operator: ComparisonOperator.And,
conditions: [resourceFilter, deploymentFilter],
conditions: [resourceSelector, deploymentFilter],
};
};
const getSelector = (resourceId: string, deploymentId: string): JobCondition => {
const resourceSelector: JobCondition = {
type: JobSelectorType.JobResource,
operator: ColumnOperator.Equals,
value: resourceId,
};
const deploymentSelector: JobCondition = {
type: JobSelectorType.Deployment,
operator: ColumnOperator.Equals,
value: deploymentId,
};
return {
type: SelectorType.Comparison,
operator: ComparisonOperator.And,
conditions: [resourceSelector, deploymentSelector],
};
};

Comment on lines 4 to 15
server: {
SMTP_HOST: z.string(),
SMTP_PORT: z.coerce.number().default(587),
SMTP_USER: z.string(),
SMTP_PASS: z.string(),
SMTP_FROM: z.string(),
SMTP_SECURE: z.coerce.boolean().default(false),
},
runtimeEnv: process.env,
skipValidation: !!process.env.CI ||
!!process.env.SKIP_ENV_VALIDATION ||
process.env.npm_lifecycle_event === "lint",
Copy link
Member

Choose a reason for hiding this comment

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

we should revert

Comment on lines 4 to 13
host: env.SMTP_HOST,
port: env.SMTP_PORT,
secure: env.SMTP_SECURE,
auth: {
user: env.SMTP_USER,
pass: env.SMTP_PASS,
},
});
export const sendEmail = (payload) => {
return transporter.sendMail({ from: env.SMTP_FROM, ...payload });
return transporter.sendMail({ from: env.SMTP_FROM, ...payload });
Copy link
Member

Choose a reason for hiding this comment

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

we should revert

Comment on lines 5 to 14
theme: {
extend: {
colors: {
sidebar: {
DEFAULT: "hsl(var(--sidebar-background))",
foreground: "hsl(var(--sidebar-foreground))",
primary: "hsl(var(--sidebar-primary))",
"primary-foreground": "hsl(var(--sidebar-primary-foreground))",
accent: "hsl(var(--sidebar-accent))",
"accent-foreground": "hsl(var(--sidebar-accent-foreground))",
Copy link
Member

Choose a reason for hiding this comment

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

spacing

name: text("name").notNull(),
description: text("description").default(""),
filter: jsonb("filter").notNull().$type<ResourceCondition>(),
selector: jsonb("selector").notNull().$type<ResourceCondition>(),
Copy link
Member

Choose a reason for hiding this comment

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

I think this is still a filter because its a saved filter

</PopoverTrigger>
<PopoverContent className="w-[462px] p-0">
<Command shouldFilter={false}>
<Command shouldSelector={false}>
Copy link
Member

Choose a reason for hiding this comment

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

nit, maybe we should call this shouldSelect.

We don't have to do this as it would not be as grepable.

@j7m4 j7m4 force-pushed the j7m4/refactor-release-filter-to-selector branch from 6d24193 to f995e26 Compare March 26, 2025 20:45
resourceFilter: false,
});

const envsWithFilter =
Copy link
Contributor

Choose a reason for hiding this comment

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

envWithSelector

className="rounded-none rounded-t-lg border-none hover:ring-0 focus-visible:ring-0"
type="text"
placeholder="Filter variables..."
placeholder="Selector variables..."
Copy link
Contributor

Choose a reason for hiding this comment

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

"Search variables..."

<Link
className="flex h-full items-center gap-2 border-l border-neutral-800 pl-6"
href={`${workspaceUrls.resources().baseUrl()}?filter=${v.filterHash}`}
href={`${workspaceUrls.resources().baseUrl()}?condition=${v.filterHash}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldmake sure all the components take into account the param change

environment: SCHEMA.Environment;
workspaceId: string;
}> = ({ environment, workspaceId }) => {
const allResourcesQ = useFilteredResources(
Copy link
Contributor

Choose a reason for hiding this comment

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

nothing actionable, just wondering - what would be the verb here? "use____Resources" useSelectedResources?

onValueChange={(value) => {
if (value === "all") {
handleFilterDropdownChange(value, ResourceFilterType.Kind);
handleFilterDropdownChange(
Copy link
Contributor

Choose a reason for hiding this comment

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

handleSelectorDropdownChange

filter,
sort,
setFilter: (filter: string) => setParams({ filter }),
setFilter: (filter: string) => setParams({ filter: filter }),
Copy link
Contributor

Choose a reason for hiding this comment

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

stray change I think

);
};

const getFilter = (
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be above where it is declared

example: 60,
},
resourceFilter: {
resourceSelector: {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should make these endpoints backwards compatible

@@ -0,0 +1 @@
ALTER TABLE "resource_view" RENAME COLUMN "selector" TO "filter"; No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, should we just squash these into one

@jsbroks jsbroks marked this pull request as ready for review March 28, 2025 04:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (8)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (1)

58-58: Simplify destructuring assignment.

The current destructuring creates a useless rename where the variable name is the same on both sides of the assignment.

- const { resourceSelector: resourceSelector } = form.watch();
+ const { resourceSelector } = form.watch();
🧰 Tools
🪛 Biome (1.9.4)

[error] 58-58: Useless rename.

Safe fix: Remove the renaming.

(lint/complexity/noUselessRename)

apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/views/ResourceViewsTable.tsx (1)

31-31: Consider updating TableHead label for consistency

While the URL parameter has been updated to use "condition", the TableHead still displays "Filter" as the column label. Consider updating this for consistency with the new terminology.

-          <TableHead>Filter</TableHead>
+          <TableHead>Condition</TableHead>
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/SystemsPageContent.tsx (1)

83-83: Consider using object property shorthand.

You could simplify setCondition: (condition: string) => setParams({ condition: condition }) to setCondition: (condition: string) => setParams({ condition }).

-    setCondition: (condition: string) => setParams({ condition: condition }),
+    setCondition: (condition: string) => setParams({ condition }),
apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceCondition.ts (1)

1-76: Consider adding JSDoc comments to the hook.

While the code is well-structured, adding JSDoc comments to describe the purpose of the hook, its parameters, and return values would improve maintainability and help other developers understand its usage.

+/**
+ * Hook to manage resource conditions via URL parameters.
+ * Handles parsing/serializing conditions to/from URL and provides search functionality.
+ * 
+ * @returns {Object} Object containing condition state and related functions
+ * @returns {ResourceCondition|null} condition - The current resource condition parsed from URL
+ * @returns {Function} setCondition - Function to update the condition in the URL
+ * @returns {string|null} viewId - The current view ID from URL parameters
+ * @returns {string} search - The current search term
+ * @returns {Function} setSearch - Function to update the search term
+ */
export const useResourceCondition = () => {
packages/job-dispatch/src/deployment-update.ts (4)

45-46: Refine naming for hasFilter
Switching from resourceFilter to resourceSelector is aligned with the PR objectives. However, consider renaming hasFilter to something like hasSelector to maintain naming consistency throughout the code.

-  const hasFilter = isNotNull(SCHEMA.environment.resourceSelector);
+  const hasSelector = isNotNull(SCHEMA.environment.resourceSelector);

55-55: Clarify local naming
Although referencing resourceSelector, the local variable is called filters. For clarity, consider renaming it to selectors:

-  const filters = newSystem.environments
-    .map((env) => env.resourceSelector)
-    .filter(isPresent);
+  const selectors = newSystem.environments
+    .map((env) => env.resourceSelector)
+    .filter(isPresent);

196-199: Ensure deep comparison logic is appropriate
_.isEqual properly compares complex objects, so it should suffice here for identifying actual changes to resourceSelector. You may wish to rename handleDeploymentFilterChanged to reflect the updated “selector” terminology for clarity.


203-203: Consider updating method name for full consistency
The call to handleDeploymentFilterChanged is passing a selector, which might be confusing. Consider renaming the function to match the new terminology:

-const handleDeploymentFilterChanged = async (
+const handleDeploymentSelectorChanged = async (
   deployment: SCHEMA.Deployment,
   prevFilter: ResourceCondition | null,
   userId?: string,
 ) => { ... }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 121f9c5 and 1116459.

📒 Files selected for processing (69)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/jobs/release-table/ResourceReleaseTable.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx (4 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/DeploymentVersionEnvironmentCell.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/JobHistoryPopover.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/TableCells.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/CreateDeploymentVersionChannelDialog.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/DeploymentResourcesDialog.tsx (5 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/EditDeploymentSection.tsx (7 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/ConfigFields.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableResourceInput.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableTable.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/page.tsx (4 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/variable-data.ts (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/ResourcesPageContent.tsx (14 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useFilteredResources.ts (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/deployments/TableDeployments.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/_components/variables/VariableResourceInput.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/SystemsPageContent.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/_components/system-deployment-table/TableDeployments.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/DeploymentVersionChannelDropdown.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/Overview.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/DeploymentResourceDrawer.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/TableRow.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/version/condition/DeploymentVersionConditionDialog.tsx (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment/drawer/Filter.tsx (4 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobComparisonConditionRender.tsx (12 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobResourceConditionRender.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/RunbookJobComparisonConditionRender.tsx (8 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ComparisonConditionRender.tsx (13 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ResourceViewActionsDropdown.tsx (4 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceCondition.ts (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/channel/useDeploymentVersionChannel.ts (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useCondition.ts (1 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/insights/DailyJobsChart.tsx (4 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/SidebarKinds.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/groupings/[groupId]/CombincationsTable.tsx (3 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx (8 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/providers/page.tsx (2 hunks)
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/views/ResourceViewsTable.tsx (1 hunks)
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/openapi.ts (1 hunks)
  • openapi.v1.json (7 hunks)
  • packages/api/src/router/deployment-variable.ts (9 hunks)
  • packages/api/src/router/deployment-version.ts (5 hunks)
  • packages/api/src/router/environment-page/deployments/deployment-stats.ts (2 hunks)
  • packages/api/src/router/environment-page/overview/router.ts (4 hunks)
  • packages/api/src/router/environment-page/resources/router.ts (2 hunks)
  • packages/api/src/router/environment-stats.ts (2 hunks)
  • packages/api/src/router/environment.ts (4 hunks)
  • packages/api/src/router/job.ts (2 hunks)
  • packages/api/src/router/system.ts (2 hunks)
  • packages/db/drizzle/0080_cuddly_mantis.sql (1 hunks)
  • packages/db/drizzle/meta/_journal.json (1 hunks)
  • packages/db/src/schema/deployment.ts (2 hunks)
  • packages/db/src/schema/environment.ts (2 hunks)
  • packages/db/src/schema/job.ts (3 hunks)
  • packages/db/src/schema/resource.ts (2 hunks)
  • packages/job-dispatch/src/deployment-update.ts (5 hunks)
  • packages/job-dispatch/src/environment-release-channel-update.ts (2 hunks)
  • packages/job-dispatch/src/events/triggers/deployment-removed.ts (1 hunks)
  • packages/job-dispatch/src/events/triggers/environment-deleted.ts (2 hunks)
  • packages/job-dispatch/src/events/triggers/resource-deleted.ts (2 hunks)
  • packages/job-dispatch/src/release-job-trigger.ts (2 hunks)
  • packages/job-dispatch/src/resource/dispatch-resource.ts (2 hunks)
  • packages/validators/src/conditions/index.ts (1 hunks)
  • packages/validators/src/jobs/conditions/job-condition.ts (3 hunks)
  • packages/validators/src/resources/conditions/resource-condition.ts (5 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/db/drizzle/0080_cuddly_mantis.sql
🚧 Files skipped from review as they are similar to previous changes (58)
  • packages/api/src/router/environment-page/resources/router.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/channels/CreateDeploymentVersionChannelDialog.tsx
  • packages/validators/src/conditions/index.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/SidebarKinds.tsx
  • packages/api/src/router/environment-stats.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/RunbookJobComparisonConditionRender.tsx
  • packages/job-dispatch/src/release-job-trigger.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/variable-data.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/JobHistoryPopover.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/runbooks/_components/variables/VariableResourceInput.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableTable.tsx
  • packages/api/src/router/environment-page/overview/router.ts
  • apps/webservice/src/app/api/v1/workspaces/[workspaceId]/resources/[filter]/openapi.ts
  • packages/db/src/schema/deployment.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/list/ResourcePageContent.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/Overview.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/TableRow.tsx
  • packages/job-dispatch/src/resource/dispatch-resource.ts
  • packages/job-dispatch/src/events/triggers/deployment-removed.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useFilteredResources.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/page.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/ConfigFields.tsx
  • packages/job-dispatch/src/environment-release-channel-update.ts
  • packages/validators/src/resources/conditions/resource-condition.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/_components/system-deployment-table/TableDeployments.tsx
  • packages/job-dispatch/src/events/triggers/resource-deleted.ts
  • packages/api/src/router/system.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/TableCells.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/channel/useDeploymentVersionChannel.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/_components/release-cell/DeploymentVersionEnvironmentCell.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/DeploymentPageContent.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/providers/page.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/resource-drawer/DeploymentResourceDrawer.tsx
  • packages/api/src/router/deployment-variable.ts
  • packages/db/src/schema/resource.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ComparisonConditionRender.tsx
  • packages/api/src/router/environment.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/ResourceViewActionsDropdown.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobComparisonConditionRender.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/environment/drawer/Filter.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/job/condition/JobResourceConditionRender.tsx
  • packages/db/src/schema/environment.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/jobs/release-table/ResourceReleaseTable.tsx
  • packages/api/src/router/environment-page/deployments/deployment-stats.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(raw)/[resourceId]/deployments/ResourceDeploymentRow.tsx
  • packages/api/src/router/deployment-version.ts
  • packages/db/src/schema/job.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(sidebar)/deployments/TableDeployments.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/insights/DailyJobsChart.tsx
  • packages/job-dispatch/src/events/triggers/environment-deleted.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/variables/VariableResourceInput.tsx
  • packages/db/drizzle/meta/_journal.json
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/ResourcesPageContent.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/DeploymentResourcesDialog.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(raw)/releases/[releaseId]/checks/_components/flow-diagram/EnvironmentNode.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/deployments/[deploymentSlug]/(sidebar)/properties/EditDeploymentSection.tsx
  • packages/validators/src/jobs/conditions/job-condition.ts
  • openapi.v1.json
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{ts,tsx}`: **Note on Error Handling:** Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error...

**/*.{ts,tsx}: Note on Error Handling:
Avoid strict enforcement of try/catch blocks. Code may use early returns, Promise chains (.then().catch()), or other patterns for error handling. These are acceptable as long as they maintain clarity and predictability.

  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/DeploymentVersionChannelDropdown.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/groupings/[groupId]/CombincationsTable.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/views/ResourceViewsTable.tsx
  • packages/api/src/router/job.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useCondition.ts
  • packages/job-dispatch/src/deployment-update.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/deployments/version/condition/DeploymentVersionConditionDialog.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceCondition.ts
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/SystemsPageContent.tsx
  • apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts
🧬 Code Definitions (2)
packages/api/src/router/job.ts (1)
packages/validators/src/jobs/conditions/job-condition.ts (1)
  • jobCondition (41-51)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (3)
packages/validators/src/resources/conditions/resource-condition.ts (3)
  • ResourceCondition (27-36)
  • isComparisonCondition (76-79)
  • resourceCondition (38-48)
packages/validators/src/jobs/conditions/job-condition.ts (1)
  • isComparisonCondition (72-75)
packages/db/src/schema/environment.ts (1)
  • environment (49-74)
🪛 Biome (1.9.4)
apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts

[error] 58-58: Useless rename.

Safe fix: Remove the renaming.

(lint/complexity/noUselessRename)

🔇 Additional comments (28)
packages/api/src/router/job.ts (1)

397-398: Consistent renaming of filter to condition.

The parameter in the input schema and its corresponding usage in the query have been correctly updated from filter to condition. This change aligns with the PR objective to refactor filter terminology to condition/selector throughout the codebase.

Also applies to: 423-424

apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/groupings/[groupId]/CombincationsTable.tsx (2)

17-18: Good addition of the constant for improved maintainability.

Defining CONDITION_PARAM as a constant rather than using hardcoded strings is a good practice that makes the code more maintainable. This aligns with the PR's objective of renaming "filter" to "condition" throughout the codebase.


45-60: Consistent renaming from "filter" to "condition" terminology.

The renaming of filterHash to conditionHash and the use of the CONDITION_PARAM constant for the URL parameter is consistent with the PR objective. This change properly maintains the functionality while updating the terminology across the codebase.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/channel/drawer/DeploymentVersionChannelDropdown.tsx (2)

26-27: Good improvement: Added a constant for URL parameter.

Using a named constant instead of a magic string improves code maintainability and readability. This aligns with the PR objective of replacing "filter" terminology with "condition" throughout the codebase.


44-44: Correctly updated URL parameter handling.

The code now uses the CONDITION_PARAM constant instead of the hardcoded "filter" string, maintaining consistency with the broader refactoring effort in the PR.

Make sure that any bookmarked URLs or external systems using the old "filter" parameter will still work or are properly redirected to use the new "condition" parameter.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(raw)/systems/[systemSlug]/(raw)/environments/[environmentId]/resources/_hooks/useEnvResourceEditor.ts (1)

10-10: LGTM: Filter to condition/selector renaming is consistent.

The renaming from "filter" to "condition" and "selector" terminology has been implemented consistently throughout this file, matching the changes made across the codebase. All variable names, type references, and function parameters have been updated appropriately.

Also applies to: 20-30, 34-34, 54-54, 63-63

apps/webservice/src/app/[workspaceSlug]/(app)/resources/(sidebar)/views/ResourceViewsTable.tsx (2)

42-42: Query parameter correctly updated from "filter" to "condition"

The URL query parameter has been updated to use "condition" instead of "filter", which aligns with the broader refactoring effort to standardize terminology across the codebase.


50-50: Property name inconsistency

The component is called ResourceConditionBadge and uses condition as prop name, but it receives view.filter as the value. This suggests the data structure still uses the old naming convention. This might be expected during a multi-step refactoring, but it creates a semantic inconsistency.

Consider verifying if the filter property in the view object should also be renamed to condition for complete consistency, or if this is intentionally left for backward compatibility.

apps/webservice/src/app/[workspaceSlug]/(app)/(deploy)/(sidebar)/systems/SystemsPageContent.tsx (7)

51-52: LGTM: Good constant naming.

The constant name CONDITION_PARAM accurately reflects the refactoring from "filter" to "condition" terminology.


53-57: LGTM: Hook renamed appropriately.

The hook has been correctly renamed from useSystemFilter to useSystemCondition, and the internal variable has been updated from filter to condition.


59-69: LGTM: Parameter handling updated consistently.

The setParams function has been updated to handle the "condition" parameter instead of "filter", with consistent implementation for setting and deleting URL parameters.


80-86: LGTM: Return values updated correctly.

The hook's return object has been properly updated to return condition instead of filter, and the setter method has been renamed to setCondition.


92-94: LGTM: Component updated to use new hook.

The component is now correctly using useSystemCondition and destructuring condition and setCondition.


95-102: LGTM: Effect dependencies updated properly.

The effect's dependencies and logic have been updated to use condition and setCondition instead of their "filter" counterparts.


105-108: LGTM: API query parameter updated.

The API query parameter has been correctly updated to use condition instead of filter.

apps/webservice/src/app/[workspaceSlug]/(app)/_components/resources/condition/useResourceCondition.ts (6)

9-10: Good use of constants to improve maintainability.

Creating a constant for "condition" parameter name helps avoid magic strings and makes the code more maintainable.


11-11: Hook renamed to reflect "condition" terminology.

The hook name has been appropriately updated as part of the systematic renaming from "filter" to "condition" throughout the codebase.


16-26: Logic updated to use condition parameter with proper error handling.

The useMemo implementation correctly retrieves and parses the condition parameter from the URL with appropriate null checks and error handling.


30-48: URL manipulation function properly renamed and updated.

The callback function for setting conditions in the URL has been updated with consistent naming and maintains all the existing functionality.


53-69: Search functionality correctly updated to use condition terminology.

The debounced search handler has been properly updated to use the new "condition" terminology while maintaining the same functionality.


75-75: Return value updated to reflect the new terminology.

The hook's return object now correctly uses "condition" terminology while maintaining the same structure and functionality.

apps/webservice/src/app/[workspaceSlug]/(app)/_hooks/useCondition.ts (2)

7-45: Great implementation of the useCondition hook!

This is a well-structured hook with proper type safety using generics, efficient memoization with useMemo and useCallback, and good error handling throughout the parsing and compression processes. The renaming from "filter" to "condition/selector" aligns well with the PR objectives.


5-5: Verify terminology consistency across codebase.

The constant CONDITION_PARAM is set to "selector" which seems to mix the terminology being used. According to the PR objectives, you're refactoring from "filter" to "selector" or "condition", but the hook is named useCondition while the parameter is named "selector".

Please verify this is intentional and consistent with the naming strategy across the codebase. If the hook is named useCondition, typically the parameter would be named "condition" as well.

packages/job-dispatch/src/deployment-update.ts (5)

11-11: Consistent rename to ConditionType
No issues found. This alignment from FilterType to ConditionType adheres to the new naming convention and appears correct.


61-61: Good update to ConditionType.Comparison
This update correctly reflects the transitioning terminology without further issues.


112-114: Rename from filter to selector is consistent
Using resourceSelector in the conditions array aligns well with the PR objective to shift from filters to selectors. No concerns here.


118-118: Proper use of ConditionType.Comparison
This modification is consistent with your new naming scheme.


124-126: Consistent naming in new resources filter
The object now references ConditionType.Comparison and uses the renamed resourceSelector property correctly.

const selector = localCondition ?? undefined;
const versionsQ = api.deployment.version.list.useQuery(
{ deploymentId: deploymentId ?? "", selector, limit: 5 },
{ deploymentId: deploymentId ?? "", filter: selector, limit: 5 },
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Inconsistent parameter naming with PR objective.

The PR objective is to replace "filter" terminology with "condition" or "selector", but this line is doing the opposite by using filter as the parameter name while the variable being passed is named selector. This contradicts the broader refactoring effort.

Change the parameter name from filter to selector to maintain consistency with the refactoring:

-    { deploymentId: deploymentId ?? "", filter: selector, limit: 5 },
+    { deploymentId: deploymentId ?? "", selector: selector, limit: 5 },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{ deploymentId: deploymentId ?? "", filter: selector, limit: 5 },
{ deploymentId: deploymentId ?? "", selector: selector, limit: 5 },

Comment on lines +26 to +30
try {
if (condition == null) {
url.searchParams.delete(CONDITION_PARAM);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing router update when clearing the condition.

When condition is null, the code removes the parameter but returns early without calling router.replace(). This will cause the URL to not update when clearing a condition.

if (condition == null) {
  url.searchParams.delete(CONDITION_PARAM);
-  return;
+  router.replace(`${url.pathname}?${url.searchParams.toString()}`);
+  return;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
try {
if (condition == null) {
url.searchParams.delete(CONDITION_PARAM);
return;
}
try {
if (condition == null) {
url.searchParams.delete(CONDITION_PARAM);
router.replace(`${url.pathname}?${url.searchParams.toString()}`);
return;
}

@jsbroks jsbroks merged commit e52bf0a into ctrlplanedev:main Mar 28, 2025
10 checks passed
@j7m4 j7m4 deleted the j7m4/refactor-release-filter-to-selector branch March 30, 2025 22:19
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.

4 participants