Skip to content
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

Resolve CodeQL Alert #94 - Generated by GHA #6662

Closed
7 of 10 tasks
HackforLABot opened this issue Apr 17, 2024 · 7 comments · Fixed by #6822
Closed
7 of 10 tasks

Resolve CodeQL Alert #94 - Generated by GHA #6662

HackforLABot opened this issue Apr 17, 2024 · 7 comments · Fixed by #6822
Assignees
Labels
Complexity: Medium Feature: Code Alerts role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Milestone

Comments

@HackforLABot
Copy link
Contributor

HackforLABot commented Apr 17, 2024

Prerequisite

  1. Be a member of Hack for LA. (There are no fees to join.) If you have not joined yet, please follow the steps on our Getting Started page.
  2. Before you claim or start working on an issue, please make sure you have read our How to Contribute to Hack for LA Guide.

Overview

We need to resolve the new alert (94) and either recommend dismissal of the alert or update the code files to resolve the alert.

Action Items

  • The following action item serves to "link" this issue as the "tracking issue" for the CodeQL alert and to provide more details regarding the alert:
  • https://github.com/hackforla/website/security/code-scanning/94
  • In a comment in this issue, add your analysis and recommendations. The recommendation can be one of the following: dismiss as test, dismiss as false positive, dismiss as won't fix, or update code. An example of a false positive is a report of a JavaScript syntax error that is caused by markdown or liquid symbols such as --- or {%
  • If the recommendation is to dismiss the alert:
    • Apply the label ready for dev lead
    • Move the issue to Questions/In Review
  • If the recommendation is to update code:
    • Create an issue branch and proceed with the code update
    • The code github-actions/trigger-issue/add-missing-labels-to-issues/check-labels.js is used in the workflow .github/workflows/issue-trigger.yml and cannot be tested using Docker; instead it must be tested in the developer's fork of the hackforla/website repository. For testing guidance see Create Wiki page to fill in missing GHA documentation: Issue Trigger #5166 (comment)
    • Proceed with pull request in the usual manner

Resources/Instructions

This issue was automatically generated from the codeql.yml workflow

@HackforLABot HackforLABot added the ready for dev lead Issues that tech leads or merge team members need to follow up on label Apr 17, 2024
@github-actions github-actions bot added Feature Missing This label means that the issue needs to be linked to a precise feature label. size: missing role missing Complexity: Missing labels Apr 17, 2024
@ExperimentsInHonesty ExperimentsInHonesty added this to the 02. Security milestone Apr 22, 2024
@roslynwythe roslynwythe added Complexity: Medium Feature: Code Alerts size: 1pt Can be done in 4-6 hours role: back end/devOps Tasks for back-end developers Ready for Prioritization and removed Feature Missing This label means that the issue needs to be linked to a precise feature label. size: missing role missing Complexity: Missing ready for dev lead Issues that tech leads or merge team members need to follow up on labels May 1, 2024
@t-will-gillis t-will-gillis self-assigned this May 3, 2024

This comment was marked as resolved.

@t-will-gillis

This comment was marked as resolved.

Copy link

github-actions bot commented May 5, 2024

Hi @JackCasica, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@JackCasica
Copy link
Member

Availability: May 5, 2024 (Sunday)
ETA: May 5, 2024 (Sunday)

@JackCasica
Copy link
Member

JackCasica commented May 5, 2024

My recommendation is to update code by removing unused variable results

  try {
    const results = await github.rest.issues.setLabels({
      owner: owner,
      repo: repo,
      issue_number: issueNum,
      labels: labels
    })
    if (labelsToAdd.length > 0) {
      console.log('Succesfully added labels: ', labelsToAdd);
    }
    return true
  }
  catch(err) {
    console.log('Error editing labels: ', err)
    return false
  }

Will be:

  try {
    await github.rest.issues.setLabels({
      owner: owner,
      repo: repo,
      issue_number: issueNum,
      labels: labels
    })
    if (labelsToAdd.length > 0) {
      console.log('Succesfully added labels: ', labelsToAdd);
    }
    return true
  }
  catch(err) {
    console.log('Error editing labels: ', err)
    return false
  }

@JackCasica JackCasica added the ready for dev lead Issues that tech leads or merge team members need to follow up on label May 5, 2024
@t-will-gillis
Copy link
Member

Hey @JackCasica I think your proposal to update code sounds correct.

Given this, you can continue working on this issue. I will move this back to "In Progress (actively working)" and remove the ready for dev lead label and you can continue with it. If you need help with setting up an environment for testing, there is this document Hack for LA's GitHub Actions and feel free to send questions in Slack.

@t-will-gillis t-will-gillis removed the ready for dev lead Issues that tech leads or merge team members need to follow up on label May 5, 2024
@t-will-gillis
Copy link
Member

Also, you can uncheck the boxes at the section titled since you are proposing to update the code:

- [ ] If the recommendation is to dismiss the alert:
  - [ ] Apply the label ready for dev lead
  - [ ] Move the issue to Questions/In Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium Feature: Code Alerts role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Projects
Development

Successfully merging a pull request may close this issue.

5 participants