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

Frontend: Improve barrel file detection in codemod #87389

Merged
merged 4 commits into from
May 9, 2024

Conversation

jackw
Copy link
Contributor

@jackw jackw commented May 6, 2024

What is this feature?

This PR improves detection of barrel file imports in our codebase.

Why do we need this feature?

To improve the health of our frontend codebase. Prior to the changes in this PR the codemod only identified / modded ~360 files. By using require.resolve, filtering out bare specifiers and resolving app/ import paths that number creeps up to 1145 files.

Who is this feature for?

Grafana developers

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@jackw jackw added area/frontend type/debt technical debt no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels May 6, 2024
@jackw jackw added this to the 11.1.x milestone May 6, 2024
@jackw jackw self-assigned this May 6, 2024
@jackw jackw requested a review from a team as a code owner May 6, 2024 12:17
@jackw jackw requested review from gabor and removed request for a team May 6, 2024 12:17
Copy link
Contributor

@gabor gabor left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Left some comments, but nothing blocking.

scripts/codemods/explicit-barrel-imports.cjs Outdated Show resolved Hide resolved
scripts/codemods/explicit-barrel-imports.cjs Outdated Show resolved Hide resolved
scripts/codemods/explicit-barrel-imports.cjs Show resolved Hide resolved
scripts/codemods/explicit-barrel-imports.cjs Show resolved Hide resolved
@jackw jackw force-pushed the jackw/fix-barrel-imports-codemod branch from 3be18ae to 901f045 Compare May 8, 2024 08:20
@jackw jackw force-pushed the jackw/fix-barrel-imports-codemod branch from 901f045 to 8360e71 Compare May 8, 2024 14:54
@jackw jackw merged commit 6380a01 into main May 9, 2024
12 checks passed
@jackw jackw deleted the jackw/fix-barrel-imports-codemod branch May 9, 2024 08:49
obetomuniz added a commit that referenced this pull request May 9, 2024
…-tracker

* gops-configuration-tracker: (51 commits)
  Reorganize hooks into separate folders/files for each app
  add aria and properties role for Progressbar
  Address pr review comments part1
  Update dependency @opentelemetry/semantic-conventions to v1.24.1 (#87544)
  update test
  Update dependency @grafana/scenes to v4.17.2
  fix logic behind default contact point check
  new yarn version
  Update Yarn to v4.2.2
  remove unnecessary AlertmanagerProvider
  alerting: integrations > small update (#87538)
  RBAC: Adding action set resolver for RBAC evaluation (#86801)
  Frontend: Improve barrel file detection in codemod (#87389)
  Unified Storage: Add SQL template package (#87524)
  Sql Expressions: use display name for sql tables (#87530)
  Azure Monitor: Update grafana-azure-sdk-go to v2.0.3 (#87480)
  Timeseries: Fix incorrect threshold style (#87521)
  GRPC Server: Add README (#87442)
  Ephemeral instances: update go version (#87526)
  Scopes: Add a /find query endpoint (#87457)
  ...
@kevinwcyu kevinwcyu modified the milestones: 11.1.x, 11.1.0 Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes type/debt technical debt
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants