Skip to content

fix: correctly return cookie value in banner-dismiss.js#55716

Merged
k8s-ci-robot merged 4 commits into
kubernetes:mainfrom
Nithin0620:fix/banner-dismiss-getcookie-bug
May 9, 2026
Merged

fix: correctly return cookie value in banner-dismiss.js#55716
k8s-ci-robot merged 4 commits into
kubernetes:mainfrom
Nithin0620:fix/banner-dismiss-getcookie-bug

Conversation

@Nithin0620

Copy link
Copy Markdown
Contributor

Description

This PR fixes the getCookie() function in assets/js/banner-dismiss.js.

Previously, the function returned "true" whenever the cookie existed, regardless of the cookie's actual stored value. This caused incorrect behavior for any logic depending on the real cookie value.

The fix updates getCookie() to return the decoded cookie value using decodeURIComponent(matches[1]).

Additionally, the redundant check:

acknowledged === "true"

has been simplified to a truthy check after fixing getCookie():

if (acknowledged) {
  announcement.remove();
}

This makes the logic cleaner, more reliable, and future-proof.

Changes Made

  • Fixed getCookie() to return the actual cookie value.
  • Replaced hardcoded "true" return behavior.
  • Simplified acknowledgment condition check.
  • Improved maintainability and correctness of banner dismissal logic.

@linux-foundation-easycla

linux-foundation-easycla Bot commented May 8, 2026

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @Nithin0620!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/docs Categorizes an issue or PR as relevant to SIG Docs. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 8, 2026
Comment thread assets/js/banner-dismiss.js Outdated
Comment thread assets/js/banner-dismiss.js Outdated
Comment thread assets/js/banner-dismiss.js Outdated
Comment thread assets/js/banner-dismiss.js Outdated
Comment thread assets/js/banner-dismiss.js Outdated
Comment thread assets/js/banner-dismiss.js Outdated
Comment thread assets/js/banner-dismiss.js Outdated
@Nithin0620 Nithin0620 force-pushed the fix/banner-dismiss-getcookie-bug branch from ebcdc0a to c01bb0a Compare May 8, 2026 13:18
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 8, 2026
Comment thread assets/js/banner-dismiss.js Outdated
@netlify

netlify Bot commented May 8, 2026

Copy link
Copy Markdown

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 70ae4f9
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/69fde9291ca1e80008c8f41e
😎 Deploy Preview https://deploy-preview-55716--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@stmcginnis

Copy link
Copy Markdown
Contributor

Thanks!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 8, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: c0294bc4b233cd7d904aed6ae93588f70c9a6164

@Arhell Arhell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lgtm

@lmktfy lmktfy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/label tide/merge-method-squash

/approve

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 9, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmktfy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 9, 2026
@k8s-ci-robot k8s-ci-robot merged commit 156a67a into kubernetes:main May 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants