Skip to content

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Oct 13, 2023

Part of #292

This will let you set the agent by either ID or name. If both are set then the name is ignored.

@code-asher code-asher requested a review from johnstcn October 13, 2023 22:49
@code-asher code-asher force-pushed the asher/agent-id branch 2 times, most recently from b421edc to 00231a3 Compare October 13, 2023 23:14
@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2023

Qodana Community for JVM

53 new problems were found

Inspection name Severity Problems
Unused symbol 🔶 Warning 30
Unstable API Usage 🔶 Warning 8
Incorrect string capitalization 🔶 Warning 7
Call to 'equals()' or 'hashCode()' on 'URL' object 🔶 Warning 2
Local 'var' is never modified and can be declared as 'val' 🔶 Warning 1
Redundant semicolon 🔶 Warning 1
Useless call on not-null type 🔶 Warning 1
Class member can have 'private' visibility ◽️ Notice 1
Size check can be replaced with 'isNotEmpty()' ◽️ Notice 1
Trailing comma recommendations ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

  1. Register at Qodana Cloud and configure the action
  2. Use GitHub Code Scanning with Qodana
  3. Host Qodana report at GitHub Pages
  4. Inspect and use qodana.sarif.json (see the Qodana SARIF format for details)

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2023.2.6
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

It should omit agent information when the workspace specifies no agents
and the name should combine the workspace and agent names.
This generates agent models, not workspaces.  Renaming opens the way for
generating random workspaces.
I also made a tweak to check that the agent ID is not null since
toAgentModels() will return the workspace without any agent bits set if
there are no agents.

And the wrong error message would show when either the id or name were
missing.  I also flipped them around while fixing this to match the
order above it.
Comment on lines +10 to +13
// TODO: Maybe better to randomly generate the workspace and then call
// toAgentModels() on it. Also the way an "agent" model can have no
// agent in it seems weird; can we refactor to remove
// WorkspaceAgentModel and use the original structs from the API?
Copy link
Member

Choose a reason for hiding this comment

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

👍 to this, I'm assuming we auto-generate the API? I wonder if we could gen the field values from the spec.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh that would be absolutely wonderful. The API types appear to be hand-written at the moment.

Copy link
Member Author

Choose a reason for hiding this comment

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

@code-asher code-asher merged commit e3d4f7f into asher/all-agents Oct 17, 2023
@code-asher code-asher deleted the asher/agent-id branch October 17, 2023 20:01
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