Skip to content

Conversation

kitlith
Copy link

@kitlith kitlith commented Aug 19, 2025

Changes

  • Add parameter linux64RemoveExecutableExtension
    • Allows the end-user to restore the default unity behavior of using the file extension .x86_64, instead of no file extension.
    • Defaults to true for now, but is named such to highlight it as a non-default with an eye to flip the default on the next version bump.

Related Issues

Successful Workflow Run Link

PRs don't have access to secrets so you will need to provide a link to a successful run of the workflows from your own
repo.

  • ...
    • is there documentation (aside from reading all the workflow files) on what secrets this repo expects?

Checklist

  • Read the contribution guide and accept the
    code of conduct
  • Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make a PR
    in the documentation repo)
    • There may yet be some bikeshedding to do on the naming/precise functionality of the new input, since I never received any feedback on the initial issue. I'd like to wait until that is settled before I open a documentation PR.
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

Summary by CodeRabbit

  • New Features

    • Added an optional input to control removal of the default Linux 64-bit executable extension; default preserves the prior behavior of removing the extension, and providing a value retains the extension.
    • Build output for Linux 64-bit now reflects the chosen extension behavior.
  • Tests

    • Added tests covering the new input's default and user-specified behaviors and its effect on Linux 64-bit build filenames.

Allows the end-user to restore the default unity behavior of
using the file extension `.x86_64`, instead of no file extension.

Preserves the current behavior, to avoid surprise breakage.
Copy link

Cat Gif

Copy link

coderabbitai bot commented Aug 19, 2025

📝 Walkthrough

Walkthrough

Adds a new boolean input linux64RemoveExecutableExtension, exposes it via Input.linux64RemoveExecutableExtension, threads it into BuildParameters.parseBuildFile, and updates tests to validate whether StandaloneLinux64 filenames keep or drop the .x86_64 extension.

Changes

Cohort / File(s) Summary of Changes
Build parameters implementation
src/model/build-parameters.ts
Added linux64RemoveExecutableExtension parameter to parseBuildFile and applied it for StandaloneLinux64; BuildParameters.create now passes Input.linux64RemoveExecutableExtension.
Build parameters tests
src/model/build-parameters.test.ts
Expanded test matrix to include linux64RemoveExecutableExtension cases for StandaloneLinux64; mocked Input.linux64RemoveExecutableExtension; updated test descriptions and assertions to verify extension removal vs retention.
Input implementation
src/model/input.ts
Added public static getter linux64RemoveExecutableExtension that reads the input (default 'true') and returns a boolean.
Input tests
src/model/input.test.ts
Added tests validating default true and custom value retrieval for linux64RemoveExecutableExtension, and verifying core.getInput usage.
Action metadata
action.yml
Added optional input linux64RemoveExecutableExtension (default: 'true', required: false) with description about removing the .x86_64 extension for StandaloneLinux64.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as GitHub Action
  participant Input as Input
  participant BP as BuildParameters

  User->>Action: Trigger workflow
  Action->>Input: read linux64RemoveExecutableExtension
  Input-->>Action: return true / false
  Action->>BP: BuildParameters.create(filename, platform, androidExportType, linux64RemoveExecutableExtension)
  note over BP: create() forwards linux64RemoveExecutableExtension to parseBuildFile
  BP->>BP: parseBuildFile(filename, platform, androidExportType, linux64RemoveExecutableExtension)
  alt platform == StandaloneLinux64 and linux64RemoveExecutableExtension == true
    BP-->>Action: return filename (no .x86_64 extension)
  else platform == StandaloneLinux64 and linux64RemoveExecutableExtension == false
    BP-->>Action: return filename + ".x86_64"
  else other platforms
    BP-->>Action: existing filename handling (unchanged)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Suggested labels

codex

Suggested reviewers

  • webbertakken
  • davidmfinol
  • cloudymax

Poem

I hop through CI with nimble feet,
A boolean tweak makes builds complete.
For Linux targets, tidy and keen,
Extensions vanish—or stay—on screen.
A rabbit’s nudge for cleaner art, 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

@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 (4)
src/model/input.test.ts (1)

338-349: Consider adding a fallback-env test to exercise non-core input paths.

This strengthens confidence that LINUX64_FILE_EXTENSION (env-var) works when core.getInput is empty.

You could append something like this:

it('falls back to env var LINUX64_FILE_EXTENSION when core input is empty', () => {
  const original = process.env.LINUX64_FILE_EXTENSION;
  try {
    process.env.LINUX64_FILE_EXTENSION = '.x86_64';
    jest.spyOn(core, 'getInput').mockReturnValue(''); // force fallback path
    expect(Input.linux64FileExtension).toBe('.x86_64');
  } finally {
    if (original === undefined) {
      delete process.env.LINUX64_FILE_EXTENSION;
    } else {
      process.env.LINUX64_FILE_EXTENSION = original;
    }
  }
});
src/model/build-parameters.test.ts (1)

107-115: Use empty string instead of 'n/a' for non-Linux rows to avoid unrealistic values.

The property is a plain string and unused outside the Linux branch, but keeping it '' makes the test matrix semantically cleaner.

Apply:

-      ${Platform.types.Android}             | ${'.apk'}         | ${'androidPackage'}       | ${'n/a'}
-      ${Platform.types.Android}             | ${'.aab'}         | ${'androidAppBundle'}     | ${'n/a'}
-      ${Platform.types.Android}             | ${''}             | ${'androidStudioProject'} | ${'n/a'}
-      ${Platform.types.StandaloneWindows}   | ${'.exe'}         | ${'n/a'}                  | ${'n/a'}
-      ${Platform.types.StandaloneWindows64} | ${'.exe'}         | ${'n/a'}                  | ${'n/a'}
+      ${Platform.types.Android}             | ${'.apk'}         | ${'androidPackage'}       | ${''}
+      ${Platform.types.Android}             | ${'.aab'}         | ${'androidAppBundle'}     | ${''}
+      ${Platform.types.Android}             | ${''}             | ${'androidStudioProject'} | ${''}
+      ${Platform.types.StandaloneWindows}   | ${'.exe'}         | ${'n/a'}                  | ${''}
+      ${Platform.types.StandaloneWindows64} | ${'.exe'}         | ${'n/a'}                  | ${''}
src/model/build-parameters.ts (2)

256-259: Normalize and validate linux64FileExtension to avoid surprises (leading dot, path separators).

Prevents accidental “filenamex86_64” (missing dot) or injection of path separators. Non-breaking for current tests.

Apply:

-    if (platform === Platform.types.StandaloneLinux64) {
-      return `${filename}${linux64FileExtension}`;
-    }
+    if (platform === Platform.types.StandaloneLinux64) {
+      const trimmed = linux64FileExtension.trim();
+      if (/[\/\\]/.test(trimmed)) {
+        throw new Error('Invalid linux64FileExtension: must not contain path separators');
+      }
+      const normalized = trimmed === '' ? '' : (trimmed.startsWith('.') ? trimmed : `.${trimmed}`);
+      return `${filename}${normalized}`;
+    }

256-259: Add a Linux64 predicate to Platform (optional)

There isn’t currently a Platform.isLinux64 (or Platform.isLinux) helper in src/model/platform.ts. To stay consistent with the existing Platform.isWindows and Platform.isAndroid predicates—and for easier future extensions—you might add one:

In src/model/platform.ts:

static isLinux64(platform: string): boolean {
  return platform === Platform.types.StandaloneLinux64;
}

Then in src/model/build-parameters.ts (around line 256):

- if (platform === Platform.types.StandaloneLinux64) {
+ if (Platform.isLinux64(platform)) {
    return `${filename}${linux64FileExtension}`;
  }

This refactor is optional but will keep your platform checks uniform.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c6c8236 and 893ac80.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (4)
  • src/model/build-parameters.test.ts (1 hunks)
  • src/model/build-parameters.ts (3 hunks)
  • src/model/input.test.ts (1 hunks)
  • src/model/input.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/model/build-parameters.test.ts (1)
src/model/input.ts (3)
  • targetPlatform (80-82)
  • androidExportType (162-164)
  • linux64FileExtension (285-287)
src/model/build-parameters.ts (1)
src/model/input.ts (2)
  • androidExportType (162-164)
  • linux64FileExtension (285-287)
🔇 Additional comments (4)
src/model/input.ts (1)

285-288: LGTM: new linux64FileExtension input is correctly exposed and defaults to empty string.

Matches existing Input getter patterns and preserves current behavior by default.

src/model/input.test.ts (1)

338-349: LGTM: tests cover default and explicit values for linux64FileExtension.

Clear, minimal, and consistent with other Input getter tests.

src/model/build-parameters.test.ts (1)

106-127: LGTM: matrix now validates Linux64 filename behavior with and without extension.

Good coverage tying Input.linux64FileExtension into BuildParameters.create and parse logic.

src/model/build-parameters.ts (1)

104-109: Correctly threading linux64FileExtension into parseBuildFile.

This keeps the extension decision centralized in parseBuildFile and preserves default behavior when the input is empty.

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: 1

🧹 Nitpick comments (2)
action.yml (2)

271-272: Clarify accepted formats in the description (leading dot vs no dot).

Minor wording tweak to preempt ambiguity about whether users should include the leading dot. If your parsing already normalizes both, reflect that here; if not, this makes the expectation explicit.

Apply this diff to clarify:

-    description:
-      'Specify the file extension of the executable when building for StandaloneLinux64. For example, ".x86_64"'
+    description:
+      'Specify the file extension of the executable when building for StandaloneLinux64. For example, ".x86_64". Leave empty to omit. You may include or omit the leading dot; the builder will handle both.'

268-273: Remember to update docs and usage examples.

Once merged, add this input to README/action usage matrix and provide a snippet for enabling Unity’s default “.x86_64” extension.

Happy to draft the documentation snippet and a minimal example workflow if you’d like.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 893ac80 and dc38016.

📒 Files selected for processing (1)
  • action.yml (1 hunks)
🔇 Additional comments (1)
action.yml (1)

268-273: LGTM: New linux64FileExtension input is well-scoped and consistent.

Name, placement, and defaults align with existing inputs. Description clearly communicates the intent and example.

and the rest that this entails.

This PR should probably be squashed before merging,
with attention paid to the commit message.
@kitlith kitlith changed the title Add parameter linux64FileExtension Add parameter linux64RemoveExecutableExtension Aug 20, 2025
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: 0

🧹 Nitpick comments (1)
src/model/input.ts (1)

285-289: Normalize boolean parsing to be case/whitespace-insensitive

Users sometimes pass True/TRUE or include spaces in workflow YAML. Normalizing here avoids subtle surprises and mirrors a more robust pattern.

   static get linux64RemoveExecutableExtension(): boolean {
-    const input = Input.getInput('linux64RemoveExecutableExtension') ?? 'true';
-
-    return input === 'true';
+    const raw = (Input.getInput('linux64RemoveExecutableExtension') ?? 'true').trim().toLowerCase();
+    return raw === 'true';
   }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dc38016 and 20df148.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (5)
  • action.yml (1 hunks)
  • src/model/build-parameters.test.ts (1 hunks)
  • src/model/build-parameters.ts (3 hunks)
  • src/model/input.test.ts (1 hunks)
  • src/model/input.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/model/input.test.ts
  • action.yml
  • src/model/build-parameters.ts
  • src/model/build-parameters.test.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/model/input.ts (1)
src/model/index.ts (1)
  • Input (19-19)
🔇 Additional comments (2)
src/model/input.ts (2)

285-289: LGTM: adds boolean input with backward-compatible default

The getter correctly defaults to removing the extension (true), which preserves current behavior and avoids breaking changes.


285-289: No lingering linux64FileExtension — repo uses linux64RemoveExecutableExtension

Search results show no occurrences of linux64FileExtension; the code, tests and action metadata use linux64RemoveExecutableExtension:

  • action.yml — linux64RemoveExecutableExtension (lines ~268–270)
  • src/model/input.ts — getter linux64RemoveExecutableExtension (lines ~285–289)
  • src/model/input.test.ts — tests for linux64RemoveExecutableExtension (around lines ~338–351)
  • src/model/build-parameters.ts & src/model/build-parameters.test.ts — consume/mock linux64RemoveExecutableExtension
  • dist/index.js — compiled references to linux64RemoveExecutableExtension

Conclusion: no changes required in code/docs to remove an old name — you can consider updating the PR title (if it still says linux64FileExtension) to match linux64RemoveExecutableExtension.

@kitlith
Copy link
Author

kitlith commented Aug 20, 2025

making a couple of the AI nitpicks more visible:

256-259: Add a Linux64 predicate to Platform (optional)

There isn’t currently a Platform.isLinux64 (or Platform.isLinux) helper in src/model/platform.ts. To stay consistent with the existing Platform.isWindows and Platform.isAndroid predicates—and for easier future extensions—you might add one:

Felt redundant to me, then again Platform.isAndroid feels redundant to me, unlike Platform.isWindows, so shrug

285-289: Normalize boolean parsing to be case/whitespace-insensitive

Users sometimes pass True/TRUE or include spaces in workflow YAML. Normalizing here avoids subtle surprises and mirrors a more robust pattern.

Feels like this would be better off in a separate PR that normalizes the boolean parsing everywhere. As-is, I'm using the same pattern that is used everywhere else in the file.

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.

1 participant