Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
55 changes: 52 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mPCA.acquireTokenSilentAsync(scopes, account, authority, callback); // ❌ Depr
```gradle
// build.gradle (app level)
minSdk 24, targetSdk 35, compileSdk 35
implementation "com.microsoft.identity.client:msal:7.+"
implementation "com.microsoft.identity.client:msal:8.+"
```

```properties
Expand Down Expand Up @@ -144,12 +144,61 @@ Logger.getInstance().setEnablePII(true); // Only for debugging
- [ ] `auth_config.json` in `res/raw/` with URL-encoded redirect_uri
- [ ] AndroidManifest.xml with non-URL-encoded signature hash in intent-filter
- [ ] Required permissions: `INTERNET`, `ACCESS_NETWORK_STATE`
- [ ] MSAL 7.+ dependency in build.gradle
- [ ] MSAL 8.+ dependency in build.gradle
- [ ] AndroidX enabled in gradle.properties

### Template Usage
**Always use:** `auth_config.template.json` for configuration structure
**Copy exactly:** Gradle files from golden examples (only change applicationId/namespace)
**Resource structure:** Follow golden examples for res/ directory layout

**Remember:** When in doubt, check snippets/ directory first, then golden examples. Never invent patterns.
**Remember:** When in doubt, check snippets/ directory first, then golden examples. Never invent patterns.

## 6. GitHub Issue Handling (For AI Agents)

When responding to GitHub issues, AI agents should follow these guidelines:

### Issue Response Resources
- **Common Issues Guide:** [`issue-responses/common-issues-guide.md`](issue-responses/common-issues-guide.md) - Comprehensive troubleshooting reference
- **Communication Guidelines:** [`issue-responses/customer-communication-guidelines.md`](issue-responses/customer-communication-guidelines.md) - Professional response templates
- **Automated Workflow:** [`workflows/copilot-issue-response.yml`](workflows/copilot-issue-response.yml) - Automatic triage and response

### Quick Issue Diagnosis

**Configuration Issues (Most Common):**
1. Redirect URI encoding mismatch (auth_config.json vs AndroidManifest.xml)
2. Missing `BrowserTabActivity` in AndroidManifest.xml
3. Incorrect client_id or signature hash

**Runtime Issues:**
1. PCA not initialized before use
2. UI updates not on main thread
3. Wrong account mode API used

**Build Issues:**
1. Missing AndroidX properties in gradle.properties
2. MSAL version conflicts
3. ProGuard/R8 stripping required classes

### Response Protocol

1. **Always acknowledge** the issue with empathy
2. **Check the common issues guide** before investigating
3. **Request missing information** using the standard template
4. **Reference documentation** and code snippets
5. **Never share** sensitive information or make timeline promises

### Diagnostic Information to Request

When an issue is unclear, ask for:
- MSAL version
- Android version and device model
- Account mode (Single/Multiple)
- Complete error message or stack trace
- Relevant configuration files (redacted)

Enable verbose logging for detailed diagnostics:
```java
Logger.getInstance().setLogLevel(Logger.LogLevel.VERBOSE);
Logger.getInstance().setEnableLogcatLog(true);
```
53 changes: 53 additions & 0 deletions .github/issue-responses/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# MSAL Android Issue Response Resources

This directory contains resources for AI agents and team members to effectively respond to GitHub issues.

## Contents

### [common-issues-guide.md](common-issues-guide.md)
A comprehensive reference guide for diagnosing and resolving common MSAL Android issues. Includes:
- Configuration issues (redirect URI encoding, client ID, manifest setup)
- Authentication errors (AADSTS codes, user cancellation)
- Token acquisition issues (deprecated APIs, scope formats)
- Broker integration issues
- Build and dependency issues
- Runtime crashes
- Single vs Multiple account mode issues
- Silent token refresh issues

### [customer-communication-guidelines.md](customer-communication-guidelines.md)
Guidelines for professional and effective communication when responding to GitHub issues. Includes:
- Communication principles and response time expectations
- Response templates for various issue types
- Issue triage guidelines
- Escalation procedures
- Quality checklist

## Automated Issue Response

The repository includes a GitHub Actions workflow ([../workflows/copilot-issue-response.yml](../workflows/copilot-issue-response.yml)) that:
- Automatically triages new issues
- Applies appropriate labels (bug, feature-request, question, priority)
- Posts initial acknowledgment and guidance
- Detects common error patterns and provides targeted help

## Usage

### For AI Agents
1. Reference `common-issues-guide.md` when analyzing issue descriptions
2. Use templates from `customer-communication-guidelines.md` for responses
3. Follow the diagnostic checklist to request necessary information
4. Link to relevant documentation and code snippets

### For Team Members
1. Review and update these guides as new common issues emerge
2. Ensure templates remain current with API changes
3. Monitor automated responses for accuracy
4. Escalate security issues through proper channels

## Related Resources

- [Copilot Instructions](../copilot-instructions.md) - Main AI agent instructions
- [Code Snippets](../../snippets/) - Reference implementations
- [Golden Examples](../../examples/) - Complete working applications
- [Configuration Template](../../auth_config.template.json) - Full configuration options
Loading
Loading