Skip to content

Attempt to fix #151 #293

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

Closed
wants to merge 1 commit into from
Closed

Attempt to fix #151 #293

wants to merge 1 commit into from

Conversation

katyo
Copy link
Owner

@katyo katyo commented Sep 4, 2021

No description provided.

src/github.ts Outdated
@@ -84,10 +84,25 @@ query lastCommitDate($owner: String!, $repo: String!, $ref: String!, $path: Stri
)
}

const {edges} = result.repository.ref.target.history
const {history} = result.repository.ref.target

Choose a reason for hiding this comment

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

I test the code, result.repository.ref this is null, so result.repository.ref.target throws cannot read property 'target' of null

Copy link
Owner Author

Choose a reason for hiding this comment

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

Looks really strange. Seems Github's graphql API has unexpected behavior in some rare cases.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Could you try again?

Choose a reason for hiding this comment

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

Error: Unable to retrieve history for path 'libduckdb-sys' (res: {"repository":{"ref":null}})

@wangfenjin
Copy link

I think we can disable these logic, and just check the published version?

https://github.com/wangfenjin/publish-crates/blob/926eb3732ca6823d0876df86520f0f11e41c0cf2/src/main.ts#L58-L70

@wangfenjin
Copy link

@wangfenjin
Copy link

Seems related to inner package?

@katyo
Copy link
Owner Author

katyo commented Sep 14, 2021

@wangfenjin Seems the problem related to $GITHUB_REF variable value.

API request:

query lastCommitDate($owner: String!, $repo: String!,
                     $ref: String!, $path: String!) {
    repository(owner: $owner, name: $repo) {
        ref(qualifiedName: $ref) {
            target {
                ... on Commit {
                    history(first: 1, path: $path) {
                        edges {
                            node {
                                committedDate
                            }
                        }
                    }
                }
            }
        }
    }
}

Request data:

{
  "owner": "wangfenjin",
  "repo": "duckdb-rs",
  "ref": "refs/remotes/pull/23/merge",
  "path": "libduckdb-sys"
}

Response from GitHub:

{
  "data": {
    "repository": {
      "ref": null
    }
  }
}

We may try to find solution or bypass this logic as a quick fix.

NOTE: This check prevents forgetting to change version of package which contents changed since previously published version so bypassing this logic little bit dangerous.

@katyo
Copy link
Owner Author

katyo commented Sep 14, 2021

@wangfenjin At all I think publishing packages using pull-requests is not so good idea in any case. I suggest you use tags for that purpose.

@katyo
Copy link
Owner Author

katyo commented Sep 14, 2021

Seems we can get last path modification time locally via git.

@katyo katyo closed this Sep 14, 2021
@katyo katyo reopened this Sep 14, 2021
@wangfenjin
Copy link

@wangfenjin At all I think publishing packages using pull-requests is not so good idea in any case. I suggest you use tags for that purpose.

Agree. For that because it's the first time using github action to release, so I want to make it work before merge the code.

So you mean, after merge to master all things should work? What about the dry-run mode, is it work in PR? Because every PR should run the dry-run mode

@katyo
Copy link
Owner Author

katyo commented Sep 14, 2021

@wangfenjin Currently I'm on a way to change implementation of this feature. New implementation will deal with local clone of repository directly without using octokit. Also it will checks contents of packages more fine grained i.e. file by file.
Maybe I will release v2 of this action. It shall works as expected in your case.

@katyo
Copy link
Owner Author

katyo commented Sep 14, 2021

Closed in favor of #311

@katyo katyo closed this Sep 14, 2021
@katyo
Copy link
Owner Author

katyo commented Sep 14, 2021

@wangfenjin Could you test pr #311 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants