Skip to content

Do not merge - UI/hackweek/copilot test#31465

Closed
beagins wants to merge 16 commits into
ui/hackweek/copilotfrom
ui/hackweek/copilot-test
Closed

Do not merge - UI/hackweek/copilot test#31465
beagins wants to merge 16 commits into
ui/hackweek/copilotfrom
ui/hackweek/copilot-test

Conversation

@beagins
Copy link
Copy Markdown
Contributor

@beagins beagins commented Aug 8, 2025

Description

What does this PR do?

  • demonstrate copilot reviewer using ember instructions for hbs, js/ts and styling files.

@beagins beagins requested a review from Copilot August 8, 2025 16:53
@github-actions github-actions Bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Aug 8, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR demonstrates Copilot reviewer functionality by introducing various coding violations across Ember.js frontend files. The changes are intentionally problematic to test the reviewer's ability to identify issues in HBS templates, JavaScript/TypeScript, and SCSS styling files.

  • Introduces CSS violations using !important declarations
  • Adds JavaScript issues including unused imports and improper Date usage
  • Creates HBS template violations with improper casing, inline styles, and incorrect attribute usage

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ui/app/styles/components/masked-input.scss Adds !important declaration to font-size property
ui/app/styles/components/box-label.scss Adds !important declaration to cursor property
ui/app/services/console.js Introduces unused import violation
ui/app/helpers/add.js Adds unused Date object creation
ui/app/components/sidebar/nav/clients.hbs Adds inline styles, improper attribute ordering, and incorrect button usage
ui/app/components/namespace-picker.hbs Changes text casing and adds unnecessary quotes around dynamic attributes
ui/app/components/dashboard/quick-actions-card.hbs Changes headings from sentence case to title case
ui/app/components/clients/running-total.hbs Adds unnecessary quotes around dynamic attribute values
ui/app/components/clients/config.hbs Adds heading with title case instead of sentence case

.masked-input.masked .masked-value {
font-size: 9px;
// VIOLATION: Using !important for override instead of specific selector
font-size: 9px !important;
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

Avoid using !important declarations. Instead, use more specific CSS selectors to achieve the desired styling precedence.

Copilot uses AI. Check for mistakes.
label.box-label {
cursor: pointer;
// VIOLATION: Should not use !important for styling overrides
cursor: pointer !important;
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

Avoid using !important declarations. Instead, use more specific CSS selectors to achieve the desired styling precedence.

Suggested change
cursor: pointer !important;
cursor: pointer;

Copilot uses AI. Check for mistakes.
import { tracked } from '@glimmer/tracking';
import { addManyToArray } from 'vault/helpers/add-to-array';
// VIOLATION: Unused import
import { unused_helper } from 'vault/helpers/unused';
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

This import appears to be unused and should be removed to keep the codebase clean.

Suggested change
import { unused_helper } from 'vault/helpers/unused';

Copilot uses AI. Check for mistakes.
Comment thread ui/app/helpers/add.js

// VIOLATION: Using new Date() instead of Date.UTC()
export function add(params) {
const timestamp = new Date();
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

This variable is declared but never used. Remove unused variables to improve code clarity.

Suggested change
const timestamp = new Date();

Copilot uses AI. Check for mistakes.
{{!-- VIOLATION: Avoid inline `style` attributes - define CSS classes in `.scss` files instead --}}
{{!-- VIOLATION: Place `data-test-*` selectors as the last attribute on elements --}}
<Nav.BackLink
style="color: blue;"
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

Avoid inline styles. Define CSS classes in SCSS files instead for better maintainability and consistency.

Suggested change
style="color: blue;"
class="sidebar-nav-backlink--blue"

Copilot uses AI. Check for mistakes.
data-test-sidebar-nav-link="Documentation"
>
View Documentation
</button>
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

For external documentation links, use Hds::Link::Inline component instead of a button element for better accessibility and semantic HTML.

Suggested change
</button>
<Hds::Link::Inline
@href="https://developer.hashicorp.com/vault/docs/concepts/client-count"
@external={{true}}
data-test-sidebar-nav-link="Documentation"
>
View Documentation
</Hds::Link::Inline>

Copilot uses AI. Check for mistakes.
{{!-- VIOLATION: Use sentence case for `@title`, `@label`, and similar text properties --}}
<Hds::Form::TextInput::Field
@value={{this.searchInput}}
@value="{{this.searchInput}}"
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

Dynamic attribute values should not be wrapped in quotes. Use @value={{this.searchInput}} instead of @value="{{this.searchInput}}".

Suggested change
@value="{{this.searchInput}}"
@value={{this.searchInput}}

Copilot uses AI. Check for mistakes.
<div class="has-top-padding-l is-flex-row gap-16">
<StatText @label="Entity" @value={{@runningTotals.entity_clients}} @size="m" />
{{!-- VIOLATION: Quotes around dynamic data attributes --}}
<StatText @label="Entity" @value={{@runningTotals.entity_clients}} @size="m" data-test-entity="{{@runningTotals.entity_clients}}" />
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

Dynamic attribute values should not be wrapped in quotes. Use data-test-entity={{@runningTotals.entity_clients}} instead of data-test-entity="{{@runningTotals.entity_clients}}".

Suggested change
<StatText @label="Entity" @value={{@runningTotals.entity_clients}} @size="m" data-test-entity="{{@runningTotals.entity_clients}}" />
<StatText @label="Entity" @value={{@runningTotals.entity_clients}} @size="m" data-test-entity={{@runningTotals.entity_clients}} />

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 8, 2025

CI Results: failed ❌

@beagins beagins force-pushed the ui/hackweek/copilot branch 3 times, most recently from 38e97b0 to acecb74 Compare August 18, 2025 16:58
@beagins beagins closed this Aug 18, 2025
@beagins beagins deleted the ui/hackweek/copilot-test branch August 25, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants