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

[Bug]: 'mason publish' fails to add tags for remote package repo #25012

Open
benharsh opened this issue May 8, 2024 · 2 comments
Open

[Bug]: 'mason publish' fails to add tags for remote package repo #25012

benharsh opened this issue May 8, 2024 · 2 comments

Comments

@benharsh
Copy link
Member

benharsh commented May 8, 2024

When mason publish is executed, a tag is neither created nor pushed to a remote repository for the package.

We either need to:

a) treat this as a bug that needs fixing, or...
b) document that this requires some manual user intervention

@lucaferranti
Copy link
Contributor

I had a quick look at MasonPublish.chpl (but this was very quick and while livecoding on stream, so easy I missed something).

It seems it tries to create the tag in these lines

      if !exists(safeDir + "/Bricks/" + name + "/" + versionNum + ".toml") {
        const baseToml = tomlFile;
        var newToml = open(safeDir + "/Bricks/" + name + "/" + versionNum + ".toml", ioMode.cw);
        var tomlWriter = newToml.writer(locking=false);
        baseToml["brick"]!.set("source", projectLocal);
        tomlWriter.write(baseToml);
        tomlWriter.close();
        const gitMessageString = ('git tag -a "v' + versionNum + '" -m "' + name + '"');
        commitSubProcess(projectLocal, ['git','tag','-a',"v"+versionNum,'-m',name]);
        return name + '@' + versionNum;
      }

(note also that the constant gitMessageString is not used and the same command is recreated in the line below.

I checked my repository locally and no tag was created, so that command seem to fail. I haven't looked deeper, but stating the obviuos, possible reasons are.

  1. The branch is not entered, which would mean the given toml file already exists. This should really not be the case
  2. The commitSubProcess fails (maybe missing permissions). However, when I ran mason publish I did not get any error message indicating something didn't work, so if this is the case, it was a silent failure.

Looking at the file, I didn't find any git push --tags so as far as I can tell, the function does not try to push the tags, so that's a missing feature probably.

@benharsh
Copy link
Member Author

I think you're looking in the right place. In particular, I think that branch pertains to working with a local repository and package, rather than trying to add something to the remote public mason repository. We will need to add a git push --tags for both cases, I believe.

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

No branches or pull requests

3 participants