-
Notifications
You must be signed in to change notification settings - Fork 0
Merge/develop to master #24
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
Changes from all commits
4278fc9
1f1f0fc
abd24dd
60174d4
5849509
242268e
32fbed8
01c6680
21e78f1
6afb8bc
47bb5fb
a0ec3aa
5bcecc4
74328f8
5687484
65adb21
bd36b19
93368cd
0bfab9d
2d2e3fd
9ce680a
a20a829
53005a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||||||||||||||||||||||||||||||||
| - Enhanced code quality and automation tooling | ||||||||||||||||||||||||||||||||
| - Improved CI/CD integration and monitoring capabilities | ||||||||||||||||||||||||||||||||
|
Comment on lines
+7
to
+13
|
||||||||||||||||||||||||||||||||
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @CISCODE-MA/devops |
| 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 |
| 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 |
There was a problem hiding this comment.
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.jsonfrom 1.0.13 → 1.0.15 (patch). Additionally, the current publish workflow validates/publishes based onpackage.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).