Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: python/python-docs-es
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.12
Choose a base ref
...
head repository: rtobar/python-docs-es
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.12
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 20, 2023

  1. Obtiene SHA correcto para calcular entradas faltantes

    La versión anterior usaba github.event.pull_request.merge_commit_sha
    para obtener el commit con el merge entre la rama origen y la rama
    destino. Sin embargo, este atributo no siempre está disponible. En
    primer lugar, el atributo puede ser un string o null:
    
    https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#pull_request
    
    Y segundo, la documentación aclara que el atributo se establece sólo si
    el atributo "mergeable" es "true", lo cual no ocurre necesariamente de
    forma inmediate después de abrir un PR. Según
    https://docs.github.com/en/free-pro-team@latest/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request:
    
    """
    The value of the mergeable attribute can be true, false, or null. If the
    value is null, then GitHub has started a background job to compute the
    mergeability. After giving the job time to complete, resubmit the
    request. When the job finishes, you will see a non-null value for the
    mergeable attribute in the response. If mergeable is true, then
    merge_commit_sha will be the SHA of the test merge commit.
    """
    
    Este delay en el cálculo de la mergeabilidad de los PRs es probablemente
    lo que está causando que nuestra acción no funcione como deseamos: al
    ejecutarse la primera vez cuando se abre el PR, la acción NO tiene un
    merge_commit_sha establecido, por lo que la acción "checkout" procede
    con el valor por defecto para el evento pull_request_target, que es la
    rama destino, por lo que todas las entradas aparecen como no traducidas.
    
    Este commit cambia el SHA al que hacemos checkout al principio de esta
    acción para simplemente obtener el HEAD de la rama de origen. En
    retrospectiva, obtener el commit de merge no reporta beneficios.
    
    Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
    rtobar committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    d82ae78 View commit details
    Browse the repository at this point in the history
Loading