Skip to content

feat: Add GitLab integration#353

Open
puneetnith28 wants to merge 27 commits intofossasia:mainfrom
puneetnith28:adding-gitlab-token-auth-v2
Open

feat: Add GitLab integration#353
puneetnith28 wants to merge 27 commits intofossasia:mainfrom
puneetnith28:adding-gitlab-token-auth-v2

Conversation

@puneetnith28
Copy link
Contributor

Description

Adds full GitLab integration to Scrum Helper, matching existing GitHub functionality with platform-specific enhancements, security fixes, and localization support.

Key Changes

  • GitLab Integration: Token authentication, group & project filtering, search/autocomplete, keyboard navigation, persistent selections
  • Platform Switching: Fixed GitHub/GitLab UI toggling with platform-specific token and user storage
  • Security: Resolved Chrome Web Store-reported XSS issues via proper input sanitization
  • Internationalization: GitLab translations added to all locales
  • Error Handling: API timeouts, rate limits, and user-friendly authentication errors

Testing

  • GitLab API integration tested
  • Platform switching & storage persistence verified
  • XSS vulnerabilities resolved

Screenshot-------------->>>>>>>>>>>>

image

Closes #270

Copilot AI review requested due to automatic review settings February 1, 2026 18:10
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @puneetnith28, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Copy link
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

Adds GitLab support to the extension, aiming to mirror existing GitHub functionality while improving security (XSS sanitization) and adding i18n strings for new UI.

Changes:

  • Add GitLab token authentication and pass token into GitLabHelper for authenticated requests.
  • Add GitLab-specific UI (token field, project filtering UI, platform-specific section toggling) and sanitize several UI-rendered strings.
  • Extend localization files with new GitLab-related strings across multiple locales.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
src/scripts/scrumHelper.js Passes stored GitLab token into GitLabHelper, adds GitLab group/project filter parameters, and sanitizes error rendering.
src/scripts/popup.js Adds GitLab token visibility toggle, GitLab project filter UI logic, and sanitizes repository/project rendering.
src/scripts/gitlabHelper.js Adds token-aware request headers, timeouts, centralized error handling, and GitLab group/project filtering in data fetch.
src/popup.html Adds GitLab token/project filter/group inputs and switches platform section visibility to CSS-based toggling.
src/index.css Adds baseline .githubOnlySection / .gitlabOnlySection visibility styles.
src/_locales/zh_TW/messages.json Adds a new locale file including GitLab-related strings.
src/_locales/zh_CN/messages.json Adds GitLab-related strings for Simplified Chinese locale.
src/_locales/vi/messages.json Adds GitLab-related strings for Vietnamese locale.
src/_locales/uk/messages.json Adds GitLab-related strings for Ukrainian locale.
src/_locales/te/messages.json Adds GitLab-related strings for Telugu locale.
src/_locales/ru/messages.json Adds GitLab-related strings for Russian locale.
src/_locales/pt_BR/messages.json Adds GitLab-related strings for Brazilian Portuguese locale.
src/_locales/pt/messages.json Adds GitLab-related strings for Portuguese locale.
src/_locales/nb/messages.json Adds GitLab-related strings for Norwegian Bokmål locale.
src/_locales/ja/messages.json Adds GitLab-related strings for Japanese locale.
src/_locales/it/messages.json Adds GitLab-related strings for Italian locale.
src/_locales/id/messages.json Adds GitLab-related strings for Indonesian locale.
src/_locales/hi/messages.json Adds GitLab-related strings for Hindi locale.
src/_locales/he/messages.json Adds GitLab-related strings for Hebrew locale.
src/_locales/fr/messages.json Adds GitLab-related strings for French locale.
src/_locales/es/messages.json Adds GitLab-related strings for Spanish locale.
src/_locales/en/messages.json Adds GitLab-related strings for English locale.
src/_locales/de/messages.json Adds GitLab-related strings for German locale.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 07:57
Copy link
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

Copilot reviewed 23 out of 23 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

puneetnith28 and others added 2 commits February 2, 2026 13:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 10:08
Copy link
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@puneetnith28
Copy link
Contributor Author

puneetnith28 commented Feb 2, 2026

Hello @vedansh-5
Please review this PR and let me know if any changes are required
As you closed the last PR regarding this, because of the new Changes in the repo and tell me to raise another one so i raised the new one

Copy link
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

Copilot reviewed 26 out of 26 changed files in this pull request and generated 18 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/scripts/gitlabHelper.js:331

  • headers is built from token but the requests below use this.getHeaders(token) instead, leaving headers unused. This dead code is easy to get out of sync (e.g., missing future header allowlisting) — consider removing headers entirely and relying on getHeaders everywhere.
		// Update token if provided and build headers
		if (token) {
			this.token = token;
		}
		const headers = {};
		if (token) {
			headers['PRIVATE-TOKEN'] = token;
		}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/scripts/scrumHelper.js:165

  • The chrome.storage.local.get(..., (items) => { ... }) callback has a mis-indented if (outputTarget === 'popup') { ... } closing brace, which makes the control flow hard to follow and increases the risk of future logic errors in this already-complex function. Reformat this block so the closing brace aligns correctly and the subsequent assignments (userReason, githubToken, etc.) are clearly inside the callback.
				if (outputTarget === 'popup') {
					const usernameFromDOM = document.getElementById('platformUsername')?.value;
					const projectFromDOM = document.getElementById('projectName')?.value;
					const tokenFromDOM = document.getElementById('githubToken')?.value;
					const gitlabTokenFromDOM = document.getElementById('gitlabToken')?.value;

					// Save platform-specific username only when non-empty (avoid clearing stored value)
					const usernameTrim = (usernameFromDOM || '').trim();
					if (usernameTrim) {
						chrome.storage.local.set({ [platformUsernameKey]: usernameTrim });
						platformUsername = usernameTrim;
						platformUsernameLocal = usernameTrim;
					}

					// apply projectName from DOM immediately in popup mode
					items.projectName = projectFromDOM || items.projectName;

					// Save platform-specific token (use gitlabToken input when platform is gitlab)
					if (platform === 'gitlab') {
						items.gitlabToken = gitlabTokenFromDOM || items.gitlabToken;
					} else {
						items.githubToken = tokenFromDOM || items.githubToken;
					}

					// Persist projectName and tokens in one call
					chrome.storage.local.set({
						projectName: items.projectName,
						githubToken: items.githubToken,
						gitlabToken: items.gitlabToken,
					});
			}

			userReason = items.userReason || 'No Blocker at the moment';
				githubToken = items.githubToken;
				gitlabToken = items.gitlabToken || '';
				yesterdayContribution = items.yesterdayContribution;
				if (typeof items.enableToggle !== 'undefined') {
					enableToggle = items.enableToggle;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 20, 2026 06:24
Copy link
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@puneetnith28
Copy link
Contributor Author

Hello @mariobehling @vedansh-5

This PR is ready for review.

Please let me know if any further changes are required.
Thank you!

Copilot AI review requested due to automatic review settings March 1, 2026 05:33
Copy link
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

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/scripts/gitlabHelper.js:290

  • fetchGitLabData’s in-flight request handling is broken: the early return if (this.cache.fetching || ...) return this.cache.data; causes concurrent callers during an active fetch to immediately return null/stale cache.data, and makes the later queueing branch (if (this.cache.fetching) { return new Promise(...) }) unreachable. Remove this.cache.fetching from the early-return condition so concurrent calls properly wait on the queued promise (or otherwise share the in-flight request).
		if (this.cache.fetching || (this.cache.cacheKey === cacheKey && this.cache.data)) {
			return this.cache.data;
		}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@vedansh-5 vedansh-5 left a comment

Choose a reason for hiding this comment

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

Please pull in the latest changes and resolve conflicts. Thanks.

@puneetnith28
Copy link
Contributor Author

Please pull in the latest changes and resolve conflicts. Thanks.

sure

@puneetnith28 puneetnith28 requested a review from vedansh-5 March 3, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config core extension frontend javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Add Support for GitLab Authentication Token

4 participants