helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Method/function props of exported objects are not server functions

This is a follow-up fix for #72969. Method or function properties of exported objects in `"use cache"` or `"use server"` files must not be compiled into server functions, unless they have an inline server directive.

Changed files:
filename: crates/next-custom-transforms/src/transforms/server_actions.rs
patch: @@ -1190,13 +1190,15 @@ impl<C: Comments> VisitMut for ServerActions<C> {
 
     fn visit_mut_prop_or_spread(&mut self, n: &mut PropOrSpread) {
         let old_arrow_or_fn_expr_ident = self.arrow_or_fn_expr_ident.clone();
+        let old_in_exported_expr = self.in_exported_expr;
 
         match n {
             PropOrSpread::Prop(box Prop::KeyValue(KeyValueProp {
                 key: PropName::Ident(ident_name),
                 value: box Expr::Arrow(_) | box Expr::Fn(_),
                 ..
             })) => {
+                self.in_exported_expr = false;
                 self.arrow_or_fn_expr_ident = Some(ident_name.clone().into());
             }
             PropOrSpread::Prop(box Prop::Method(MethodProp { key, .. })) => {
@@ -1205,7 +1207,9 @@ impl<C: Comments> VisitMut for ServerActions<C> {
                     self.arrow_or_fn_expr_ident = Some(ident_name.clone().into());
                 }
                 self.rewrite_expr_to_proxy_expr = None;
+                self.in_exported_expr = false;
                 n.visit_mut_children_with(self);
+                self.in_exported_expr = old_in_exported_expr;
                 if let Some(expr) = &self.rewrite_expr_to_proxy_expr {
                     *n = PropOrSpread::Prop(Box::new(Prop::KeyValue(KeyValueProp {
                         key,
@@ -1230,6 +1234,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
 
         n.visit_mut_children_with(self);
         self.arrow_or_fn_expr_ident = old_arrow_or_fn_expr_ident;
+        self.in_exported_expr = old_in_exported_expr;
     }
 
     fn visit_mut_callee(&mut self, n: &mut Callee) {

filename: crates/next-custom-transforms/tests/fixture/server-actions/server/56/input.js
patch: @@ -0,0 +1,13 @@
+'use cache'
+
+// No method nor function property should be considered a cache function.
+export const obj = {
+  foo() {
+    return 1
+  },
+  async bar() {
+    return 2
+  },
+  baz: () => 2,
+  qux: async () => 3,
+}

filename: crates/next-custom-transforms/tests/fixture/server-actions/server/56/output.js
patch: @@ -0,0 +1,14 @@
+/* __next_internal_action_entry_do_not_use__ {} */ import { registerServerReference } from "private-next-rsc-server-reference";
+import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
+import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
+// No method nor function property should be considered a cache function.
+export const obj = {
+    foo () {
+        return 1;
+    },
+    async bar () {
+        return 2;
+    },
+    baz: ()=>2,
+    qux: async ()=>3
+};
Repository: ollama/ollama
Pull request: Fix a build warning again

With the latest main branch, there is a build warning
```
# github.com/ollama/ollama/gpu
In file included from gpu_info_oneapi.h:4,
                 from gpu_info_oneapi.c:3:
gpu_info_oneapi.c: In function ‘oneapi_init’:
gpu_info_oneapi.c:101:27: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘zes_driver_handle_t’ {aka ‘struct _zes_driver_handle_t *’} [-Wformat=]
  101 |     LOG(resp->oh.verbose, "calling zesDeviceGet %d\n", resp->oh.drivers[d]);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~
      |                                                                        |
      |                                                                        zes_driver_handle_t {aka struct _zes_driver_handle_t *}
gpu_info.h:33:23: note: in definition of macro ‘LOG’
   33 |       fprintf(stderr, __VA_ARGS__); \
      |                       ^~~~~~~~~~~
gpu_info_oneapi.c:101:50: note: format string is defined here
  101 |     LOG(resp->oh.verbose, "calling zesDeviceGet %d\n", resp->oh.drivers[d]);
      |                                                 ~^
      |                                                  |
      |                                                  int
```

Changed files:
filename: gpu/gpu_info_oneapi.c
patch: @@ -98,7 +98,7 @@ void oneapi_init(char *oneapi_lib_path, oneapi_init_resp_t *resp) {
   }
 
   for (d = 0; d < resp->oh.num_drivers; d++) {
-    LOG(resp->oh.verbose, "calling zesDeviceGet %d\n", resp->oh.drivers[d]);
+    LOG(resp->oh.verbose, "calling zesDeviceGet count %d: %p\n", d, resp->oh.drivers[d]);
     ret = (*resp->oh.zesDeviceGet)(resp->oh.drivers[d],
                                    &resp->oh.num_devices[d], NULL);
     if (ret != ZE_RESULT_SUCCESS) {
Repository: electron/electron
Pull request: fix: `app.accessibilitySupportEnabled` 

Backport of #48041

See that PR for details.


Notes: Fixed an issue where `app.accessibilitySupportEnabled` didn't work as expected. 

Changed files:
filename: shell/browser/api/electron_api_app.cc
patch: @@ -1159,7 +1159,8 @@ void App::DisableDomainBlockingFor3DAPIs(gin_helper::ErrorThrower thrower) {
 
 bool App::IsAccessibilitySupportEnabled() {
   auto* ax_state = content::BrowserAccessibilityState::GetInstance();
-  return ax_state->GetAccessibilityMode() == ui::kAXModeComplete;
+  auto mode = ax_state->GetAccessibilityMode();
+  return mode.has_mode(ui::kAXModeComplete.flags());
 }
 
 void App::SetAccessibilitySupportEnabled(gin_helper::ErrorThrower thrower,
Repository: huggingface/transformers
Pull request: Fix `pr_slow_ci_suggestion.yml` after #42023

# What does this PR do?

Fix the error

> Error: An error occurred trying to start process '/usr/bin/bash' with working directory '/home/runner/work/transformers/transformers'. Argument list too long

in `.github/workflows/pr_slow_ci_suggestion.yml` after #42023 .

See https://github.com/huggingface/transformers/actions/runs/19115938842/job/54624899519

Changed files:
filename: .github/workflows/pr_slow_ci_suggestion.yml
patch: @@ -23,11 +23,26 @@ jobs:
     outputs:
       jobs: ${{ steps.get_jobs.outputs.jobs_to_run }}
     steps:
+      # This checkout to the main branch
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: "0"
+
+      - name: Write pr_files file
+        env:
+          PR_FILES: ${{ needs.get-pr-info.outputs.PR_FILES }}
+        run: |
+          cat > pr_files.txt << EOF
+          $PR_FILES
+          EOF
+
       - name: Get repository content
         id: repo_content
         uses: actions/github-script@v6
         with:
           script: |
+            const fs = require('node:fs');
+
             const { data: tests_dir } = await github.rest.repos.getContent({
               owner: '${{ needs.get-pr-info.outputs.PR_HEAD_REPO_OWNER }}',
               repo: '${{ needs.get-pr-info.outputs.PR_HEAD_REPO_NAME }}',
@@ -49,46 +64,10 @@ jobs:
               ref: '${{ needs.get-pr-info.outputs.PR_HEAD_SHA }}',
             });
 
-            core.setOutput('tests_dir', tests_dir);
-            core.setOutput('tests_models_dir', tests_models_dir);
-            core.setOutput('tests_quantization_dir', tests_quantization_dir);
-
-      # This checkout to the main branch
-      - uses: actions/checkout@v4
-        with:
-          fetch-depth: "0"
-
-      - name: Write pr_files file
-        env:
-          PR_FILES: ${{ needs.get-pr-info.outputs.PR_FILES }}
-        run: |
-          cat > pr_files.txt << EOF
-          $PR_FILES
-          EOF
-
-      - name: Write tests_dir file
-        env:
-          tests_dir: ${{ steps.repo_content.outputs.tests_dir }}
-        run: |
-          cat > tests_dir.txt << EOF
-          $tests_dir
-          EOF
-
-      - name: Write tests_models_dir file
-        env:
-          tests_models_dir: ${{ steps.repo_content.outputs.tests_models_dir }}
-        run: |
-          cat > tests_models_dir.txt << EOF
-          $tests_models_dir
-          EOF
-
-      - name: Write tests_quantization_dir file
-        env:
-          tests_quantization_dir: ${{ steps.repo_content.outputs.tests_quantization_dir }}
-        run: |
-          cat > tests_quantization_dir.txt << EOF
-          $tests_quantization_dir
-          EOF
+            // Write to files instead of outputs
+            fs.writeFileSync('tests_dir.txt', JSON.stringify(tests_dir, null, 2));
+            fs.writeFileSync('tests_models_dir.txt', JSON.stringify(tests_models_dir, null, 2));
+            fs.writeFileSync('tests_quantization_dir.txt', JSON.stringify(tests_quantization_dir, null, 2));
 
       - name: Run script to get jobs to run
         id: get_jobs
Repository: ggml-org/llama.cpp
Pull request: scripts : follow api redirects in pr2wt.sh

Necessary if you have cloned a repository that has been moved/renamed, f.ex. `ggerganov/llama.cpp`.

Changed files:
filename: scripts/pr2wt.sh
patch: @@ -40,7 +40,7 @@ org_repo=${org_repo%.git}
 
 echo "org/repo: $org_repo"
 
-meta=$(curl -sSf -H "Accept: application/vnd.github+json" "https://api.github.com/repos/$org_repo/pulls/$PR")
+meta=$(curl -sSLf -H "Accept: application/vnd.github+json" "https://api.github.com/repos/$org_repo/pulls/$PR")
 
 url_remote=$(echo "$meta" | jq -r '.head.repo.clone_url')
 head_ref=$(echo "$meta" | jq -r '.head.ref')
Repository: vercel/next.js
Pull request: Handle `Origin: null` headers

Closes https://linear.app/vercel/issue/NEXT-4752
Closes https://github.com/vercel/next.js/issues/84786

`Origin: null` is valid per spec: https://www.rfc-editor.org/rfc/rfc6454#section-7.3

The original issue description is a bit sus to me. But then it's probably just good discipline to handle valid spec values.

Changed files:
filename: packages/next/src/server/app-render/action-handler.ts
patch: @@ -551,9 +551,10 @@ export async function handleAction({
   // When running actions the default is no-store, you can still `cache: 'force-cache'`
   workStore.fetchCache = 'default-no-store'
 
+  const originHeader = req.headers['origin']
   const originDomain =
-    typeof req.headers['origin'] === 'string'
-      ? new URL(req.headers['origin']).host
+    typeof originHeader === 'string' && originHeader !== 'null'
+      ? new URL(originHeader).host
       : undefined
   const host = parseHostHeader(req.headers)
 

filename: packages/next/src/server/lib/router-utils/block-cross-site.ts
patch: @@ -85,7 +85,7 @@ export const blockCrossSite = (
   // ensure websocket requests from allowed origin
   const rawOrigin = req.headers['origin']
 
-  if (rawOrigin) {
+  if (rawOrigin && rawOrigin !== 'null') {
     const parsedOrigin = parseUrl(rawOrigin)
 
     if (parsedOrigin) {

filename: test/e2e/app-dir/actions-allowed-origins/app-action-allowed-origins.test.ts
patch: @@ -26,4 +26,17 @@ describe('app-dir action allowed origins', () => {
       return await browser.elementByCss('#res').text()
     }, 'hi')
   })
+
+  it('should not crash for requests from privacy sensitive contexts', async function () {
+    const res = await next.fetch('/', {
+      method: 'POST',
+      headers: {
+        Origin: 'null',
+        'Content-type': 'application/x-www-form-urlencoded',
+        'Sec-Fetch-Site': 'same-origin',
+      },
+    })
+
+    expect({ status: res.status }).toEqual({ status: 200 })
+  })
 })
Repository: facebook/react
Pull request: [compiler] Ref validation repro for ImportSpecifier with renamed local

This was originally reported in https://github.com/reactwg/react-compiler/discussions/27.

Adding a failing repro to capture this case.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31383).
* #31385
* #31384
* __->__ #31383

Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.bug-import-as-local.expect.md
patch: @@ -0,0 +1,71 @@
+
+## Input
+
+```javascript
+import {
+  useEffect,
+  useRef,
+  // @ts-expect-error
+  experimental_useEffectEvent as useEffectEvent,
+} from 'react';
+
+let id = 0;
+function uniqueId() {
+  'use no memo';
+  return id++;
+}
+
+export function useCustomHook(src: string): void {
+  const uidRef = useRef(uniqueId());
+  const destroyed = useRef(false);
+  const getItem = (srcName, uid) => {
+    return {srcName, uid};
+  };
+
+  const getItemEvent = useEffectEvent(() => {
+    if (destroyed.current) return;
+
+    getItem(src, uidRef.current);
+  });
+
+  useEffect(() => {
+    destroyed.current = false;
+    getItemEvent();
+  }, []);
+}
+
+function Component() {
+  useCustomHook('hello');
+  return <div>Hello</div>;
+}
+
+export const FIXTURE_ENTRYPOINT = {
+  fn: Component,
+  isComponent: true,
+  params: [{x: 1}],
+};
+
+```
+
+
+## Error
+
+```
+  19 |   };
+  20 |
+> 21 |   const getItemEvent = useEffectEvent(() => {
+     |                                       ^^^^^^^
+> 22 |     if (destroyed.current) return;
+     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+> 23 |
+     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+> 24 |     getItem(src, uidRef.current);
+     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+> 25 |   });
+     | ^^^^ InvalidReact: Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef) (21:25)
+  26 |
+  27 |   useEffect(() => {
+  28 |     destroyed.current = false;
+```
+          
+      
\ No newline at end of file

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.bug-import-as-local.tsx
patch: @@ -0,0 +1,42 @@
+import {
+  useEffect,
+  useRef,
+  // @ts-expect-error
+  experimental_useEffectEvent as useEffectEvent,
+} from 'react';
+
+let id = 0;
+function uniqueId() {
+  'use no memo';
+  return id++;
+}
+
+export function useCustomHook(src: string): void {
+  const uidRef = useRef(uniqueId());
+  const destroyed = useRef(false);
+  const getItem = (srcName, uid) => {
+    return {srcName, uid};
+  };
+
+  const getItemEvent = useEffectEvent(() => {
+    if (destroyed.current) return;
+
+    getItem(src, uidRef.current);
+  });
+
+  useEffect(() => {
+    destroyed.current = false;
+    getItemEvent();
+  }, []);
+}
+
+function Component() {
+  useCustomHook('hello');
+  return <div>Hello</div>;
+}
+
+export const FIXTURE_ENTRYPOINT = {
+  fn: Component,
+  isComponent: true,
+  params: [{x: 1}],
+};
Repository: nodejs/node
Pull request: doc: fix typo on child_process.md

This note on `options.stdio` mentions that it's not recommended to pass `stdin` as a writable stream and `stdout/stderr` as readable, but then proceeds to say to always check that `stdin` is writable and `stdout/stderr` are readable.

Going by the examples and the fact that `process.stdin` is readable and `process.stdout/process.stderr` are writable, I'm assuming that the types in the recommendation got swapped.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/child_process.md
patch: @@ -1078,8 +1078,8 @@ pipes between the parent and child. The value is one of the following:
    them incorrectly (e.g., passing a readable stream where a writable stream is
    expected) can lead to unexpected results or errors. This practice is discouraged
    as it may result in undefined behavior or dropped callbacks if the stream
-   encounters errors. Always ensure that `stdin` is used as writable and
-   `stdout`/`stderr` as readable to maintain the intended flow of data between
+   encounters errors. Always ensure that `stdin` is used as readable and
+   `stdout`/`stderr` as writable to maintain the intended flow of data between
    the parent and child processes.
 7. Positive integer: The integer value is interpreted as a file descriptor
    that is open in the parent process. It is shared with the child
Repository: electron/electron
Pull request: fix: `app.accessibilitySupportEnabled` 

#### Description of Change

Closes https://github.com/electron/electron/issues/48039.

Fixes an issue where `app.accessibilitySupportEnabled` didn't work as expected. This happened as a result of https://github.com/electron/electron/issues/46118.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: Fixed an issue where `app.accessibilitySupportEnabled` didn't work as expected. 

Changed files:
filename: shell/browser/api/electron_api_app.cc
patch: @@ -1159,7 +1159,8 @@ void App::DisableDomainBlockingFor3DAPIs(gin_helper::ErrorThrower thrower) {
 
 bool App::IsAccessibilitySupportEnabled() {
   auto* ax_state = content::BrowserAccessibilityState::GetInstance();
-  return ax_state->GetAccessibilityMode() == ui::kAXModeComplete;
+  auto mode = ax_state->GetAccessibilityMode();
+  return mode.has_mode(ui::kAXModeComplete.flags());
 }
 
 void App::SetAccessibilitySupportEnabled(gin_helper::ErrorThrower thrower,
Repository: ollama/ollama
Pull request: Implement custom github release action

This implements the release logic we want via gh cli to support updating releases with rc tags in place and retain release notes and other community reactions.

Changed files:
filename: .github/workflows/release.yaml
patch: @@ -437,6 +437,7 @@ jobs:
     env:
       OLLAMA_SKIP_IMAGE_BUILD: '1'
       PUSH: '1'
+      GH_TOKEN: ${{ github.token }}
     steps:
       - uses: actions/checkout@v4
       - name: Set Version
@@ -460,15 +461,20 @@ jobs:
           ls -lh dist/
           (cd dist; sha256sum * > sha256sum.txt)
           cat dist/sha256sum.txt
-      - uses: ncipollo/release-action@v1
-        with:
-          name: ${{ env.RELEASE_VERSION }}
-          allowUpdates: true
-          artifacts: 'dist/*'
-          draft: true
-          prerelease: true
-          omitBodyDuringUpdate: true
-          generateReleaseNotes: true
-          omitDraftDuringUpdate: true
-          omitPrereleaseDuringUpdate: true
-          replacesArtifacts: true
+      - name: Create or update Release
+        run: |
+          echo "Looking for existing release for ${{ env.RELEASE_VERSION }}"
+          OLD_TAG=$(gh release ls --json name,tagName | jq -r ".[] | select(.name == \"${{ env.RELEASE_VERSION }}\") | .tagName")
+          if [ -n "$OLD_TAG" ]; then
+            echo "Updating release ${{ env.RELEASE_VERSION }} to point to new tag ${GITHUB_REF_NAME}"
+            gh release edit ${OLD_TAG} --tag ${GITHUB_REF_NAME}
+          else
+            echo "Creating new release ${{ env.RELEASE_VERSION }} pointing to tag ${GITHUB_REF_NAME}"
+            gh release create ${GITHUB_REF_NAME} \
+              --title ${{ env.RELEASE_VERSION }} \
+              --draft \
+              --generate-notes \
+              --prerelease
+          fi
+          echo "Uploading artifacts for tag ${GITHUB_REF_NAME}"
+          gh release upload ${GITHUB_REF_NAME} dist/* --clobber
Repository: huggingface/transformers
Pull request: Correct syntax error in trainer.md

# What does this PR do?

A comma is missing between two parameters in the signature of compute_loss function, which results in syntax error. This PR adds this comma.

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.


Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->


## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Documentation: @stevhliu

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.



Research projects are not maintained and should be taken as is.

 -->


Changed files:
filename: docs/source/en/trainer.md
patch: @@ -187,7 +187,7 @@ from torch import nn
 from transformers import Trainer
 
 class CustomTrainer(Trainer):
-    def compute_loss(self, model: nn.Module, inputs: dict[str, Union[torch.Tensor, Any]], return_outputs: bool = False num_items_in_batch: Optional[torch.Tensor] = None):
+    def compute_loss(self, model: nn.Module, inputs: dict[str, Union[torch.Tensor, Any]], return_outputs: bool = False, num_items_in_batch: Optional[torch.Tensor] = None):
         labels = inputs.pop("labels")
         # forward pass
         outputs = model(**inputs)