Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4278fc9
chore: standardize package workflows and ci/cd configuration
Zaiidmoumni Mar 3, 2026
1f1f0fc
ops: added sonarqube_mcp-instructions
Zaiidmoumni Mar 3, 2026
abd24dd
chore: standardize npm scripts (lint, format, typecheck, test, build,…
Zaiidmoumni Mar 3, 2026
60174d4
chore: Standardize ESLint and Prettier configs with best practices
Zaiidmoumni Mar 3, 2026
5849509
chore: added comprehensive changesets for release automation
Zaiidmoumni Mar 3, 2026
242268e
docs: add standardized instruction files structure
Zaiidmoumni Mar 3, 2026
32fbed8
refactor: move instruction files to .github/instructions/
Zaiidmoumni Mar 3, 2026
01c6680
Merge branch 'develop' of github.com:CISCODE-MA/AuthKit-UI into develop
Zaiidmoumni Mar 4, 2026
21e78f1
ops: UPDATED publish workflow and dependabot PR limits
Zaiidmoumni Mar 12, 2026
6afb8bc
ops (ci): standardize publish validation and dependabot across all pa…
Zaiidmoumni Mar 30, 2026
47bb5fb
security: added CODEOWNER file for branches security
Zaiidmoumni Mar 30, 2026
a0ec3aa
ops: updated relese check workflow#
Zaiidmoumni Mar 31, 2026
5bcecc4
ci: update release check workflow
Zaiidmoumni Apr 6, 2026
74328f8
ops: updated release check jobs ]
Zaiidmoumni Apr 7, 2026
5687484
Bugfix/fix auth bootstrap bounce (#19)
saadmoumou Apr 17, 2026
65adb21
Bugfix/fix auth bootstrap bounce (#22)
saadmoumou Apr 20, 2026
bd36b19
Merge remote-tracking branch 'origin/develop' into merge/develop-to-m…
SAAD-MOUMOU Apr 20, 2026
93368cd
fix(security): upgrade axios >=1.14.1 and override follow-redirects >…
SAAD-MOUMOU Apr 20, 2026
0bfab9d
style: apply prettier formatting to all files
SAAD-MOUMOU Apr 20, 2026
2d2e3fd
fix(ci): correct sonar.tests path from 'test' to 'tests' and add .tsx…
SAAD-MOUMOU Apr 20, 2026
9ce680a
fix(ci): gate SonarCloud job to workflow_dispatch only, matching Widg…
SAAD-MOUMOU Apr 20, 2026
a20a829
added release check
SAAD-MOUMOU Apr 20, 2026
53005a3
style: prettier format release-check.yml
SAAD-MOUMOU Apr 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/authkit_ui_71368.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@ciscode/ui-authentication-kit': minor
---

## Summary

Added SonarQube MCP integration instructions for code quality analysis and automated quality gates

## Changes

- Updated package configuration and workflows
Comment on lines +1 to +11
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

This changeset declares a minor bump, but the PR also directly bumps package.json from 1.0.13 → 1.0.15 (patch). Additionally, the current publish workflow validates/publishes based on package.json + git tag, not changesets. Consider aligning on a single versioning source of truth (either apply changesets to generate the version bump, or drop the changeset if it’s not part of the release flow).

Suggested change
---
'@ciscode/ui-authentication-kit': minor
---
## Summary
Added SonarQube MCP integration instructions for code quality analysis and automated quality gates
## Changes
- Updated package configuration and workflows

Copilot uses AI. Check for mistakes.
- Enhanced code quality and automation tooling
- Improved CI/CD integration and monitoring capabilities
Comment on lines +7 to +13
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

The changeset summary focuses on SonarQube MCP instructions, but this PR also includes consumer-facing auth UI/config changes (e.g., signup custom fields, new pages, RBAC hook additions). Please update the changeset to accurately describe the user-visible changes so release notes are correct.

Suggested change
Added SonarQube MCP integration instructions for code quality analysis and automated quality gates
## Changes
- Updated package configuration and workflows
- Enhanced code quality and automation tooling
- Improved CI/CD integration and monitoring capabilities
Added new consumer-facing authentication kit capabilities, including support for signup custom fields, new auth-related pages, and RBAC hook enhancements, alongside updates to quality automation and CI tooling.
## Changes
- Added support for configurable signup custom fields in the authentication UI
- Introduced new auth-related pages and configuration updates for consumer applications
- Added RBAC hook enhancements to support role-aware authentication flows
- Updated package configuration, workflows, and code quality automation tooling

Copilot uses AI. Check for mistakes.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @CISCODE-MA/devops
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: monthly
open-pull-requests-limit: 1
groups:
npm-dependencies:
patterns:
- '*'
assignees:
- CISCODE-MA/cloud-devops
labels:
- 'dependencies'
- 'npm'
commit-message:
prefix: 'chore(deps)'
include: 'scope'
rebase-strategy: auto
275 changes: 275 additions & 0 deletions .github/instructions/bugfix.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
# Bugfix Instructions - UI Kit Module

> **Last Updated**: February 2026

---

## 🔍 Bug Investigation Process

### Phase 1: Reproduce

**Before writing any code:**

1. **Understand the issue** - Read bug report carefully
2. **Reproduce locally** - Create minimal reproduction
3. **Verify it's a bug** - Not expected behavior
4. **Check browser compatibility** - Test across browsers

**Create failing test FIRST:**

```typescript
describe('Bug: Button not disabled when loading', () => {
it('should disable button during loading', () => {
render(<Button isLoading>Click</Button>);

// This SHOULD pass but currently FAILS
expect(screen.getByRole('button')).toBeDisabled();
});
});
```

### Phase 2: Identify Root Cause

**Investigation tools:**

- **React DevTools** - Inspect component tree
- **Console logs** - Debug state changes
- **Debugger** - Breakpoints in code
- **Browser DevTools** - Check DOM/styles

```typescript
// Debug component props/state
useEffect(() => {
console.log('Props changed:', props);
}, [props]);
```

### Phase 3: Understand Impact

**Critical questions:**

- Which browsers affected?
- Does it break accessibility?
- Is there a workaround?
- Does it affect other components?

---

## 🐛 Common Bug Categories

### 1. State Management Issues

| Bug Type | Symptoms | Solution |
| ----------------- | ------------------------- | -------------------------- |
| **Stale closure** | Old values in callback | Update dependencies |
| **Infinite loop** | Component re-renders | Fix useEffect dependencies |
| **Lost state** | State resets unexpectedly | Check component key |

**Example fix:**

```typescript
// ❌ BUG - Stale closure
const [count, setCount] = useState(0);

useEffect(() => {
const timer = setInterval(() => {
setCount(count + 1); // ❌ Always uses initial count
}, 1000);
return () => clearInterval(timer);
}, []); // Missing count dependency

// ✅ FIX - Functional update
useEffect(() => {
const timer = setInterval(() => {
setCount((prev) => prev + 1); // ✅ Uses current count
}, 1000);
return () => clearInterval(timer);
}, []);
```

### 2. useEffect Issues

| Bug Type | Symptoms | Solution |
| ---------------------- | -------------------- | -------------------- |
| **Memory leak** | Performance degrades | Add cleanup function |
| **Missing cleanup** | Side effects persist | Return cleanup |
| **Wrong dependencies** | Unexpected behavior | Fix dependency array |

**Example fix:**

```typescript
// ❌ BUG - No cleanup
useEffect(() => {
const subscription = api.subscribe(handleData);
}, []);

// ✅ FIX - Cleanup on unmount
useEffect(() => {
const subscription = api.subscribe(handleData);
return () => subscription.unsubscribe();
}, []);
```

### 3. Event Handler Issues

| Bug Type | Symptoms | Solution |
| ---------------------- | ------------------- | -------------------------- |
| **Handler not called** | Click doesn't work | Check event binding |
| **Multiple calls** | Handler fires twice | Remove duplicate listeners |
| **Wrong event** | Unexpected behavior | Use correct event type |

**Example fix:**

```typescript
// ❌ BUG - Handler called immediately
<button onClick={handleClick()}> // ❌ Calls on render

// ✅ FIX - Pass function reference
<button onClick={handleClick}> // ✅ Calls on click
<button onClick={() => handleClick(arg)}> // ✅ With arguments
```

### 4. Rendering Issues

| Bug Type | Symptoms | Solution |
| ---------------------- | -------------------- | ----------------------- |
| **Conditional render** | Component disappears | Fix condition logic |
| **Key prop** | Wrong items update | Use stable unique keys |
| **Forced re-render** | Performance issues | Memoize expensive calcs |

**Example fix:**

```typescript
// ❌ BUG - Index as key
{items.map((item, index) => (
<div key={index}>{item.name}</div>
))}

// ✅ FIX - Unique stable key
{items.map(item => (
<div key={item.id}>{item.name}</div>
))}
```

### 5. Accessibility Bugs

| Bug Type | Symptoms | Solution |
| ------------------- | -------------------- | --------------------- |
| **Missing ARIA** | Screen reader issues | Add ARIA attributes |
| **No keyboard nav** | Can't use keyboard | Add keyboard handlers |
| **Poor contrast** | Hard to read | Fix colors |

**Example fix:**

```typescript
// ❌ BUG - Div as button (not accessible)
<div onClick={handleClick}>
Submit
</div>

// ✅ FIX - Proper button element
<button onClick={handleClick} aria-label="Submit form">
Submit
</button>
```

---

## 🔧 Fix Implementation Process

### 1. Write Failing Test

```typescript
it('should fix the bug', async () => {
render(<Component />);

await userEvent.click(screen.getByRole('button'));

expect(screen.getByText(/expected/i)).toBeInTheDocument();
});
```

### 2. Implement Fix

```typescript
// Fix the component
export function Component() {
// Corrected implementation
return <div>Fixed!</div>;
}
```

### 3. Verify Test Passes

```bash
npm test -- Component.test.tsx
```

### 4. Test in Browser

```bash
npm run dev
# Manually test the fix
```

### 5. Update Documentation

```typescript
/**
* Component that was buggy
*
* @fixed v1.2.3 - Fixed click handler issue
*/
export function Component(props: Props): JSX.Element;
```

---

## ⚠️ Common Gotchas

### 1. Prop Mutation

```typescript
// ❌ Bug - Mutating props
const sortedItems = props.items.sort(); // Mutates!

// ✅ Fix - Create copy
const sortedItems = [...props.items].sort();
```

### 2. Incorrect Comparison

```typescript
// ❌ Bug - Object comparison
if (user === prevUser) {
} // Always false (different references)

// ✅ Fix - Compare values
if (user.id === prevUser.id) {
}
```

### 3. Missing Null Checks

```typescript
// ❌ Bug - No null check
return user.profile.name; // Crashes if profile is null

// ✅ Fix - Optional chaining
return user?.profile?.name ?? 'Unknown';
```

---

## 📋 Bugfix Checklist

- [ ] Bug reproduced in browser
- [ ] Failing test created
- [ ] Root cause identified
- [ ] Fix implemented
- [ ] All tests pass
- [ ] Manually tested in browser
- [ ] Accessibility verified
- [ ] Documentation updated
- [ ] CHANGELOG updated
- [ ] No regression
Loading