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

Create wip #2443

Merged
merged 9 commits into from
Mar 22, 2024
Merged

Create wip #2443

merged 9 commits into from
Mar 22, 2024

Conversation

carkom
Copy link
Contributor

@carkom carkom commented Mar 8, 2024

Adding WIP to new PRs

Adding WIP to new PRs
Copy link

netlify bot commented Mar 8, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit bc2c87a
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/65fde9e0fd5c8e0008a2d6bb
😎 Deploy Preview https://deploy-preview-2443.demo.actualbudget.org
📱 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 site configuration.

Copy link
Contributor

github-actions bot commented Mar 8, 2024

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
11 4.43 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/ButtonLink.js 379 B 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/narrow.js 214.66 kB 0%
static/js/AppliedFilters.js 20.35 kB 0%
static/js/BalanceTooltip.js 6.11 kB 0%
static/js/import.js 105.26 kB 0%
static/js/wide.js 248.16 kB 0%
static/js/ReportRouter.js 1.17 MB 0%
static/js/index.js 2.53 MB 0%

Copy link
Contributor

github-actions bot commented Mar 8, 2024

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 1.2 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.2 MB 0%

Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

Will this work for PRs coming from forks?

upcoming-release-notes/2443.md Outdated Show resolved Hide resolved
.github/workflows/wip.yml Outdated Show resolved Hide resolved
.github/workflows/wip.yml Outdated Show resolved Hide resolved
carkom and others added 3 commits March 9, 2024 20:57
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
@carkom
Copy link
Contributor Author

carkom commented Mar 9, 2024

Will this work for PRs coming from forks?

I'm not sure. Can we test it somehow?

@MatissJanis
Copy link
Member

I'm not sure. Can we test it somehow?

Create a new repository with the action. Fork it. And then submit a PR to it.

@carkom
Copy link
Contributor Author

carkom commented Mar 10, 2024

I'm not sure. Can we test it somehow?

Create a new repository with the action. Fork it. And then submit a PR to it.

I can't get it working. I'm a bit outside my depth here.

@twk3
Copy link
Contributor

twk3 commented Mar 15, 2024

@carkom the workflow is missing a run line and getting this error:

[Error: .github#L1](https://github.com/actualbudget/actual/commit/a21aee7f069fe6375b413948abf4cfe51664bde7#annotation_19076203337)
every step must define a `uses` or `run` key

https://github.com/actualbudget/actual/actions/runs/8217141693

@carkom
Copy link
Contributor Author

carkom commented Mar 15, 2024

@carkom the workflow is missing a run line and getting this error:

[Error: .github#L1](https://github.com/actualbudget/actual/commit/a21aee7f069fe6375b413948abf4cfe51664bde7#annotation_19076203337)
every step must define a `uses` or `run` key

https://github.com/actualbudget/actual/actions/runs/8217141693

Yes, indeed. Do you know how to fix it? I'm a bit out of my depth on this one.

@twk3
Copy link
Contributor

twk3 commented Mar 20, 2024

Simply passing the new new title to with isn't enough to have github change the title. You need to run a command/program to perform the change.

Here is a version that works, but still needs some work (not add WIP if already found in the title for example, and maybe we should have some other escape to prevent it from running when we know we don't want it to WIP)

name: Add WIP

on:
  pull_request_target:
    types:
      - opened

jobs:
  add_wip_prefix:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Add WIP
      env:
          TITLE: ${{ github.event.pull_request.title }}
      shell: bash
      run: |
        echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
        gh pr edit ${{ github.event.pull_request.number }} -t "WIP: ${TITLE}"

@carkom
Copy link
Contributor Author

carkom commented Mar 20, 2024

Thanks @twk3. Super helpful.

The idea was to add WIP always. What scenarios do you forsee where we'd want to skip this rule?

@twk3
Copy link
Contributor

twk3 commented Mar 21, 2024

Here, I think this will work:

name: Add WIP

on:
  pull_request_target:
    types:
      - opened

jobs:
  add_wip_prefix:
    if: |
      join(github.event.pull_request.requested_reviewers) == ''
        && !contains(github.event.pull_request.title, 'WIP')
        && !contains(github.event.pull_request.labels.*.name, 'WIP')
        && github.event.pull_request.draft != true
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Add WIP
      env:
          TITLE: ${{ github.event.pull_request.title }}
      shell: bash
      run: |
        echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
        gh pr edit ${{ github.event.pull_request.number }} -t "WIP: ${TITLE}"

This will skip if WIP is already in the title (so we don't add it again). Skip if opened in draft (taffico will already add WIP label). Skip if already labeled as WIP by the PR creator. (doesn't really matter, but saves them from having to edit the title later), and skips if a reviewer is assigned right from review creation (I think this makes sense, AND gives us an escape if a maintainer is trying to get in a quick release related fix during the release procedures for example)

@carkom carkom changed the title Create wip WIP: Create wip Mar 22, 2024
@carkom
Copy link
Contributor Author

carkom commented Mar 22, 2024

@MatissJanis , I've tested this on a dummy fork. Working as expected.

Thanks @twk3 !!

@carkom carkom changed the title WIP: Create wip Create wip Mar 22, 2024
@MatissJanis
Copy link
Member

MatissJanis commented Mar 22, 2024

I don't think this would work in a fork PRs coming from forks as forks don't have access to github secret tokens AFAIK.

Would you mind sending the link where you tested it?

@carkom
Copy link
Contributor Author

carkom commented Mar 22, 2024

I don't think this would work in a fork PRs coming from forks as forks don't have access to github secret tokens AFAIK.

Would you mind sending the link where you tested it?

carkom/hello-world#3

Master repo is on my profile. Forked that master from actualbudget project. Sent PR via acutal (forked repo). The job picked it up and changed the title.

MatissJanis
MatissJanis previously approved these changes Mar 22, 2024
Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

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

Thanks!

@carkom
Copy link
Contributor Author

carkom commented Mar 22, 2024

Thanks!

Sorry, slight change to syntax change "WIP: " to "[WIP] "

@carkom carkom merged commit e44fbb3 into master Mar 22, 2024
19 checks passed
@carkom carkom deleted the carkom-patch-1 branch March 22, 2024 20:53
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants