Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial version of pages #21

Merged
merged 5 commits into from
Nov 14, 2024
Merged

Initial version of pages #21

merged 5 commits into from
Nov 14, 2024

Conversation

evgenyk
Copy link
Member

@evgenyk evgenyk commented Nov 14, 2024

Initial version of pages discovery and bundling

🛟 If you need help, consider asking for advice over in the Kinde community.

Copy link

coderabbitai bot commented Nov 14, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces extensive modifications to the projectBundler and workflowBundler packages by implementing generics across various structures and functions. Key structures such as KindeWorkflow, KindePage, KindeEnvironment, and KindeProject have been updated to accept type parameters, enhancing their flexibility. Additionally, new types for settings have been introduced, and existing methods have been refactored to accommodate these changes. The test files have also been updated to reflect the new structure and to improve test coverage.

Changes

File Change Summary
projectBundler/projectBundler.go - Updated KindeWorkflow, KindePage, KindeEnvironment, and KindeProject to use generics with type parameters.
- Modified ProjectBundler interface and related functions to support generics.
- Renamed discover method to discoverWorkflows and added discoverPages.
- Updated maybeAddWorkflow to be generic.
projectBundler/projectBundler_test.go - Updated test paths and added new types workflowSettings and pageSettings.
- Modified NewProjectBundler instantiation to use generics.
- Expanded assertions to include checks for the Pages property in kindeProject.
runtime_test.go - Introduced new types workflowSettings and pageSettings.
- Updated NewProjectBundler calls to use generics.
- Modified testExecution function to accept KindeWorkflow[workflowSettings].
testData/kindeSrc/environment/pages/(auth)/loginPage/page.tsx - Introduced a new server-side component file with a handleRequest function and an empty pageSettings object.
testData/kindeSrc/environment/pages/page.tsx - Added a new server-side component file with a handleRequest function and an empty pageSettings object.
workflowBundler/workflowBundler.go - Made WorkflowSettings, BundledContent, BundlerResult, BundlerOptions, and WorkflowBundler generic with a type parameter.
- Updated methods to utilize the new generic types and added a UnmarshalJSON method to WorkflowSettings.
workflowBundler/workflowBundler_test.go - Added a new struct workflowSettings with fields for workflow settings.
- Updated NewWorkflowBundler instantiation to use generics.
- Modified assertions to check for specific error messages and settings structure.

Possibly related PRs

Suggested reviewers

  • davidkinde
  • kinde-engineering

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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 resolve resolve all the CodeRabbit review comments.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 85.22727% with 13 lines in your changes missing coverage. Please review.

Project coverage is 54.31%. Comparing base (ff9e8cb) to head (3517aa5).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
projectBundler/projectBundler.go 84.31% 5 Missing and 3 partials ⚠️
workflowBundler/workflowBundler.go 86.48% 4 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
+ Coverage   53.25%   54.31%   +1.06%     
==========================================
  Files          15       15              
  Lines        1707     1751      +44     
==========================================
+ Hits          909      951      +42     
- Misses        709      711       +2     
  Partials       89       89              
Files with missing lines Coverage Δ
workflowBundler/workflowBundler.go 83.05% <86.48%> (+2.85%) ⬆️
projectBundler/projectBundler.go 73.04% <84.31%> (-1.96%) ⬇️

... and 1 file with indirect coverage changes

Copy link

@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: 4

🧹 Outside diff range and nitpick comments (18)
testData/kindeSrc/environment/pages/(auth)/loginPage/page.tsx (2)

1-1: Consider adding type safety for server actions

While the "use server" directive is correctly placed, consider enhancing type safety by defining proper types for server actions.

+"use server"
+
+import { z } from 'zod';
+
+export type ServerActionResponse = {
+  success: boolean;
+  data?: any;
+  error?: string;
+};

1-9: Review the architectural approach to authentication pages

A few architectural concerns to consider:

  1. This file is in a testData directory but contains actual implementation code
  2. The authentication implementation seems too simplistic for production use
  3. Consider integrating with Kinde's authentication SDK for proper security

Consider:

  • Moving the implementation to a proper source directory if this isn't meant to be test data
  • Implementing proper authentication flows using Kinde's SDK
  • Adding proper session management and security headers
  • Following authentication best practices (OWASP guidelines)
projectBundler/projectBundler_test.go (2)

12-12: Improve comment clarity for path selection

The current comment could be more descriptive about the purpose of this path. Consider clarifying that this path points to the environment directory containing both workflows and pages.

-	somePathInsideProject, _ := filepath.Abs("../testData/kindeSrc/environment") //starting in a middle of nowhere, so we need to go up to the root of the project
+	somePathInsideProject, _ := filepath.Abs("../testData/kindeSrc/environment") // Path to environment directory containing both workflows and pages

38-40: Enhance page testing coverage

The current assertions only verify the number of pages and empty error bundles. Consider adding more comprehensive tests:

  1. Extract the magic number 2 into a constant with meaningful name
  2. Add assertions for actual page properties and content
+	const expectedPageCount = 2 // Number of test pages in ../testData/kindeSrc/environment
-	assert.Equal(2, len(kindeProject.Environment.Pages))
+	assert.Equal(expectedPageCount, len(kindeProject.Environment.Pages))
 	assert.Empty(kindeProject.Environment.Pages[0].Bundle.Errors)
 	assert.Empty(kindeProject.Environment.Pages[1].Bundle.Errors)
+	// Add assertions for page properties
+	for _, page := range kindeProject.Environment.Pages {
+		assert.NotEmpty(page.ID, "Page should have an ID")
+		assert.NotEmpty(page.Path, "Page should have a path")
+		// Add more specific assertions based on expected page structure
+	}
workflowBundler/workflowBundler_test.go (3)

23-28: Consider improving the validation logic in the test

The current implementation unconditionally adds an error message in the OnDiscovered callback, which doesn't accurately test the validation logic. Consider:

  1. Making the error conditional based on the actual ID value
  2. Using a constant for the error message to maintain consistency
  3. Moving the validation logic to the actual implementation if it's a business requirement
+const errIDRequired = "ID is required"

 workflowBuilder := NewWorkflowBundler[workflowSettings](BundlerOptions[workflowSettings]{
   WorkingFolder: workflowPath,
   EntryPoints:   []string{"tokensWorkflow.ts"},
   OnDiscovered: func(bundle *BundlerResult[workflowSettings]) {
-    bundle.Errors = append(bundle.Errors, "ID is required")
+    if bundle.Content.Settings.Additional.ID == "" {
+      bundle.Errors = append(bundle.Errors, errIDRequired)
+    }
   },
 })

42-45: Improve test maintainability with constants and documentation

The test assertions use magic strings that should be defined as constants to improve maintainability and make the expected values more explicit.

+const (
+    expectedID      = "tokenGen"
+    expectedTrigger = "onTokenGeneration"
+)

-assert.Equal("tokenGen", bundlerResult.Content.Settings.Additional.ID)
-assert.Equal("onTokenGeneration", bundlerResult.Content.Settings.Additional.Trigger)
+assert.Equal(expectedID, bundlerResult.Content.Settings.Additional.ID, "workflow ID should match")
+assert.Equal(expectedTrigger, bundlerResult.Content.Settings.Additional.Trigger, "workflow trigger should match")

Line range hint 13-46: Consider adding more test cases for better coverage

The current test focuses on the happy path. Consider adding test cases for:

  • Invalid settings (empty trigger, malformed ID)
  • Bundling failures (invalid entry points, plugin errors)
  • Edge cases with the generic type parameter

Example additional test:

func Test_WorkflowBundlerErrors(t *testing.T) {
    assert := assert.New(t)
    
    // Test with invalid entry point
    workflowBuilder := NewWorkflowBundler[workflowSettings](BundlerOptions[workflowSettings]{
        WorkingFolder: workflowPath,
        EntryPoints:   []string{"nonexistent.ts"},
    })
    result := workflowBuilder.Bundle(context.Background())
    assert.NotEmpty(result.Errors, "should contain bundling errors")
}
runtime_test.go (2)

24-30: Add documentation for new types and clarify empty struct usage.

The new types lack documentation explaining their purpose and usage. Additionally, pageSettings is an empty struct which might indicate incomplete implementation.

Consider adding documentation and either:

  1. Add a comment explaining why pageSettings is empty, or
  2. Remove it if it's not needed yet and add it when required.
+// workflowSettings contains configuration for workflow execution
 type workflowSettings struct {
 	ID string `json:"id"`
 }

+// pageSettings contains configuration for page handling
+// TODO: Implement required settings for pages
 type pageSettings struct {
 }

164-164: LGTM: Function signature correctly updated for generic types.

The function signature properly incorporates the generic type parameter for workflows. Consider adding error handling for type assertions in the test to make it more robust.

 func testExecution(workflow projectBundler.KindeWorkflow[workflowSettings], assert *assert.Assertions) func(t *testing.T) {
 	return func(t *testing.T) {
 		runner := getGojaRunner()
 		logger := testLogger{}
 		workflowRuncontext := context.WithValue(context.Background(), testContextValue, "test")
 		result, err := runner.Execute(workflowRuncontext, registry.WorkflowDescriptor{
+			// ... existing code ...
 		})
 
 		if !assert.Nil(err) {
 			t.FailNow()
 		}
-		assert.Equal("testing return", fmt.Sprintf("%v", result.GetExitResult()))
+		exitResult := result.GetExitResult()
+		assert.NotNil(exitResult, "Exit result should not be nil")
+		assert.Equal("testing return", fmt.Sprintf("%v", exitResult))
 
 		idTokenMap, err := result.GetContext().GetValueAsMap("idToken")
-		assert.Nil(err)
+		if !assert.Nil(err, "Failed to get idToken map") {
+			t.FailNow()
+		}
+		assert.NotNil(idTokenMap, "idToken map should not be nil")
 		assert.Equal("test", idTokenMap["random"])
workflowBundler/workflowBundler.go (5)

19-21: Assess the necessity of introducing generics in WorkflowSettings.

The addition of generics with WorkflowSettings[TSettings any] increases complexity. While it provides flexibility for Additional settings, evaluate if this complexity is justified or if simpler alternatives could suffice for maintainability and readability.


Line range hint 77-125: Ensure build errors are handled before processing output files.

In the Bundle method, the code proceeds to process tr.OutputFiles even if tr.Errors contains errors. This could lead to unexpected behavior if the build fails but outputs are still processed. It's critical to check for build errors before handling the output files.

Apply this diff to handle build errors appropriately:

 func (b *builder[TSettings]) Bundle(ctx context.Context) BundlerResult[TSettings] {
     opts := api.BuildOptions{
         // existing options...
     }
     tr := api.Build(opts)

+    result := BundlerResult[TSettings]{}

+    if len(tr.Errors) > 0 {
+        for _, buildError := range tr.Errors {
+            result.addCompilationError(buildError)
+        }
+        if b.bundleOptions.OnDiscovered != nil {
+            b.bundleOptions.OnDiscovered(&result)
+        }
+        return result
+    }

-    result := BundlerResult[TSettings]{}

     if len(tr.OutputFiles) > 0 {
         // existing code to process output files...
     }

-    for _, buildError := range tr.Errors {
-        result.addCompilationError(buildError)
-    }

     if b.bundleOptions.OnDiscovered != nil {
         b.bundleOptions.OnDiscovered(&result)
     }

     return result
 }
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 134-134: workflowBundler/workflowBundler.go#L134
Added line #L134 was not covered by tests


[warning] 138-138: workflowBundler/workflowBundler.go#L138
Added line #L138 was not covered by tests


[warning] 142-142: workflowBundler/workflowBundler.go#L142
Added line #L142 was not covered by tests


134-134: Increase test coverage for the HasOutput method.

The HasOutput method is currently not covered by unit tests. Adding tests for this method will help ensure its correctness and prevent future regressions.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 134-134: workflowBundler/workflowBundler.go#L134
Added line #L134 was not covered by tests


175-194: Improve error handling in UnmarshalJSON.

In the UnmarshalJSON method, errors from json.Unmarshal are returned directly without additional context. Enhancing the error messages will aid in debugging.

Apply this diff to add context to the errors:

 func (settings *WorkflowSettings[TSettings]) UnmarshalJSON(data []byte) error {

     type bindings struct {
         Bindings map[string]runtimesRegistry.BindingSettings `json:"bindings"`
     }

     mapData := bindings{}
     err := json.Unmarshal(data, &mapData)
     if err != nil {
-        return err
+        return fmt.Errorf("failed to unmarshal bindings: %w", err)
     }
     settings.Bindings = mapData.Bindings

     set := new(TSettings)
     err = json.Unmarshal(data, set)
     if err != nil {
-        return err
+        return fmt.Errorf("failed to unmarshal additional settings: %w", err)
     }
     settings.Additional = *set

     return nil
 }

+// Make sure to import "fmt"
 import (
     "context"
     "encoding/json"
+    "fmt"
     "errors"
     "time"
 )
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 184-184: workflowBundler/workflowBundler.go#L184
Added line #L184 was not covered by tests


184-184: Add unit tests to cover error scenarios in UnmarshalJSON.

The error path in UnmarshalJSON, particularly when json.Unmarshal fails, is not covered by tests. Introduce unit tests with invalid JSON data to ensure that errors are handled gracefully and as expected.

Would you like assistance in creating these unit tests?

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 184-184: workflowBundler/workflowBundler.go#L184
Added line #L184 was not covered by tests

projectBundler/projectBundler.go (4)

97-98: Return early if the pages folder does not exist.

In discoverPages, after logging the warning about the missing pages folder, the function continues execution. To prevent potential errors or unnecessary processing, consider returning early, similar to discoverWorkflows.

Apply this diff to return early when the pages folder is missing:

			log.Warn().Msgf("could not find pages folder: %s", pagesPath)
+			return
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 97-98: projectBundler/projectBundler.go#L97-L98
Added lines #L97 - L98 were not covered by tests


112-124: Rename variables for consistency and clarity in maybeAddPage function.

The parameter kw represents a KindeEnvironment, so renaming it to ke improves readability and aligns with its type. Also, update references within the function accordingly.

Apply this diff to rename the parameter and variable references:

-func maybeAddPage[TWorkflowSettings, TPageSettings any](ctx context.Context, file string, rootDirectory string, kw *KindeEnvironment[TWorkflowSettings, TPageSettings]) {
+func maybeAddPage[TWorkflowSettings, TPageSettings any](ctx context.Context, file string, rootDirectory string, ke *KindeEnvironment[TWorkflowSettings, TPageSettings]) {
 		fileName := strings.ToLower(file)
 		if strings.HasSuffix(fileName, "page.ts") || strings.HasSuffix(fileName, "page.js") || strings.HasSuffix(fileName, "page.tsx") || strings.HasSuffix(fileName, "page.jsx") {
 			discoveredPage := KindePage[TPageSettings]{
 				RootDirectory: rootDirectory,
 				EntryPoints:   []string{file},
 			}
 			discoveredPage.bundleAndIntrospect(ctx)
-			kw.Pages = append(kw.Pages, discoveredPage)
+			ke.Pages = append(ke.Pages, discoveredPage)
 		}
 	}

93-110: Rename receiver in discoverPages method for consistency.

The receiver kw in the discoverPages method refers to KindeEnvironment. Renaming it to ke enhances clarity and maintains consistency with variable naming conventions.

Apply this diff to rename the receiver:

-func (kw *KindeEnvironment[TWorkflowSettings, TPageSettings]) discoverPages(ctx context.Context, absLocation string) {
+func (ke *KindeEnvironment[TWorkflowSettings, TPageSettings]) discoverPages(ctx context.Context, absLocation string) {
 	pagesPath := filepath.Join(absLocation, "environment", "pages")
 	_, err := os.Stat(pagesPath)
 	if err != nil {
 		log.Warn().Msgf("could not find pages folder: %s", pagesPath)
+		return
 	}

 	filepath.Walk(pagesPath, func(path string, info os.FileInfo, err error) error {
 		if err != nil {
 			return err
 		}
 		if !info.IsDir() {
-			maybeAddPage(ctx, info.Name(), filepath.Dir(path), kw)
+			maybeAddPage(ctx, info.Name(), filepath.Dir(path), ke)
 		}
 		return nil
 	})
 }
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 97-98: projectBundler/projectBundler.go#L97-L98
Added lines #L97 - L98 were not covered by tests


[warning] 102-103: projectBundler/projectBundler.go#L102-L103
Added lines #L102 - L103 were not covered by tests


71-71: Increase test coverage for error handling paths.

The error handling code at lines 71, 97-98, and 102-103 is not covered by tests. Adding tests for these scenarios will ensure that the code behaves correctly under error conditions.

Would you like assistance in creating unit tests for these error cases to improve coverage?

Also applies to: 97-98, 102-103

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 71-71: projectBundler/projectBundler.go#L71
Added line #L71 was not covered by tests

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ff9e8cb and 78b4720.

📒 Files selected for processing (7)
  • projectBundler/projectBundler.go (5 hunks)
  • projectBundler/projectBundler_test.go (2 hunks)
  • runtime_test.go (3 hunks)
  • testData/kindeSrc/environment/pages/(auth)/loginPage/page.tsx (1 hunks)
  • testData/kindeSrc/environment/pages/page.tsx (1 hunks)
  • workflowBundler/workflowBundler.go (7 hunks)
  • workflowBundler/workflowBundler_test.go (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • testData/kindeSrc/environment/pages/page.tsx
🧰 Additional context used
🪛 GitHub Check: codecov/patch
projectBundler/projectBundler.go

[warning] 71-71: projectBundler/projectBundler.go#L71
Added line #L71 was not covered by tests


[warning] 97-98: projectBundler/projectBundler.go#L97-L98
Added lines #L97 - L98 were not covered by tests


[warning] 102-103: projectBundler/projectBundler.go#L102-L103
Added lines #L102 - L103 were not covered by tests

workflowBundler/workflowBundler.go

[warning] 134-134: workflowBundler/workflowBundler.go#L134
Added line #L134 was not covered by tests


[warning] 138-138: workflowBundler/workflowBundler.go#L138
Added line #L138 was not covered by tests


[warning] 142-142: workflowBundler/workflowBundler.go#L142
Added line #L142 was not covered by tests


[warning] 184-184: workflowBundler/workflowBundler.go#L184
Added line #L184 was not covered by tests

🔇 Additional comments (4)
testData/kindeSrc/environment/pages/(auth)/loginPage/page.tsx (1)

7-9: ⚠️ Potential issue

Multiple improvements needed in request handler

The current implementation has several issues that need to be addressed:

  1. Using any type reduces type safety
  2. Hardcoded HTML response isn't maintainable
  3. Missing error handling and input validation
  4. HTML response doesn't follow HTML5 standards

Consider implementing these improvements:

-export default function handleRequest(event: any) {
-	return "<html><body><h1>Page</h1></body></html>";
+interface RequestEvent {
+  method: string;
+  headers: Record<string, string>;
+  // Add other relevant properties
+}
+
+export default async function handleRequest(event: RequestEvent) {
+  try {
+    // Input validation
+    if (!event?.method) {
+      throw new Error('Invalid request event');
+    }
+
+    // Return proper HTML5 document
+    return `
+      <!DOCTYPE html>
+      <html lang="en">
+        <head>
+          <meta charset="UTF-8">
+          <meta name="viewport" content="width=device-width, initial-scale=1.0">
+          <title>Login Page</title>
+        </head>
+        <body>
+          <h1>Page</h1>
+        </body>
+      </html>
+    `;
+  } catch (error) {
+    console.error('Request handling failed:', error);
+    throw error;
+  }
+}

Let's verify if similar patterns exist in other pages:

projectBundler/projectBundler_test.go (1)

14-20: Verify if pageSettings is intentionally empty

The pageSettings struct is currently empty. If this is intentional for future extensibility, consider adding a comment explaining this. If not, it might need additional fields based on the pages discovery requirements.

✅ Verification successful

Empty pageSettings struct is intentionally used as a type parameter

The empty pageSettings struct is correctly implemented as it's being used as a type parameter in DiscoveryOptions[workflowSettings, pageSettings] for project bundling. The codebase shows that actual page settings are exported as objects in the TypeScript/Next.js pages (.tsx files), suggesting this is a type-only construct for discovery purposes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if pageSettings is used with fields in other files
ast-grep --pattern 'type pageSettings struct {
  $$$
}'

# Check for any TODO comments related to pageSettings
rg -i "todo.*pagesettings"

Length of output: 266


Script:

#!/bin/bash
# Check for usages of pageSettings in test files and implementation
rg "pageSettings" -B 2 -A 2

# Check if there are any related page configuration or settings types
ast-grep --pattern 'type $_ struct {
  $$$
  Page $$$
  $$$
}'

# Look for any test cases using pageSettings
rg "func.*Test.*Page" -A 5

Length of output: 1757

workflowBundler/workflowBundler_test.go (1)

14-17: LGTM: Well-structured settings type definition

The workflowSettings struct is properly defined with appropriate JSON tags and exported fields.

runtime_test.go (1)

140-142: LGTM: Generic type parameters correctly implemented.

The project bundler initialization properly uses the new generic types, maintaining type safety while allowing for future extensibility.

projectBundler/projectBundler_test.go Show resolved Hide resolved
projectBundler/projectBundler.go Outdated Show resolved Hide resolved
projectBundler/projectBundler.go Outdated Show resolved Hide resolved
@DaveOrDead DaveOrDead merged commit 1696ece into main Nov 14, 2024
4 checks passed
@DaveOrDead DaveOrDead deleted the ev/pages branch November 15, 2024 01:58
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.

2 participants