How do I upgrade ember-data to a specific sha in ember-cli? - ember-data

I want to lock down my ember-cli project's version of ember-data to this commit, which updates the map function signatures and lets ED work with Ember 1.8.
I tried using the canary instructions as a template and doing this, and adding this to my bower.json:
"ember-data": "components/ember-data#f97d5c9adbabd7f6b4935e614bc95e49b66bb7e0",
and
"resolutions": {
"ember-data": "#f97d5c9adbabd7f6b4935e614bc95e49b66bb7e0"
}
but I'm getting the following error:
Additional error details:
fatal: reference is not a tree: f97d5c9adbabd7f6b4935e614bc95e49b66bb7e0

Solution:
You'll need to reference the sha in the canary branch of components/ember-data, not the one from emberjs/ember-data.
In your case the sha you want is 11715a514ec33ed32438d818ee501865cd4cd2c7 commit here
Update your sha's to that and you're good to go!
How I found this info:
The components/ember-data github repo autobuilds a new version on the canary branch with each commit to ember-data. The way I found the sha you needed is by looking at the commit history and finding the same day, and then the comment that contained the sha you wanted

Related

Is there a way to force NuGet to restore the latest package version during pipeline execution?

We are using an internal NuGet feed in our Azure DevOps environment to host many different packages, which are consumed in many different projects. I would like to configure the pipeline so that whenever an internal package is referenced, it is always resolved to the latest version. All of the internal references are configured with wildcards in the PackageReference tag of the .vbproj file, like so:
<PackageReference Include="MyPackageName" Version="*" />
And the restore command in the YAML file is configured like so:
- task: NuGetCommand#2
condition: and(succeeded(), eq(variables['ModifiedProject'], 'true'))
displayName: 'NuGet restore'
inputs:
command: 'restore'
restoreSolution: '$(ModifiedProject.Directory)/$(ModifiedProject.Solution)'
feedsToUse: 'select'
vstsFeed: '[guid]/[guid]'
noCache: true
The projects build successfully, but they still end up using the oldest version of the package instead of restoring the newest version. Is there a way to force the restore task to default to the newest package version?
I ended up finding a workaround for this issue by using the Azure DevOps REST API. My objective was to get the pipeline to flow through these basic steps:
After all build steps have been completed successfully, push the new package version into the artifact feed.
Use the REST API to unlist the old package version, leaving only the newest version available.
Because of the use of floating versions in the PackageReference tags, any projects that depend on these packages will then automatically pull the newest version when they are built in their respective pipelines.
I was only comfortable going this route because "deleting" a package in Azure doesn't really delete it, it just gets moved to the Recycle Bin. In the event there is a breaking change that is discovered post-push, we can always restore a previous version to the feed. Given that this process is being used exclusively for our 50+ internal packages with their own testing processes, it definitely seems like a safe route to go, and far more efficient than any other option I can find. However, I don't think I will mark this as a definitive answer to the question, because it still feels a bit hacky and I'd prefer there was a legitimate option to force newest versions in Azure's NuGetCommand#2 task.
Code
As mentioned, I used Azure's well-documented REST API for these functions, particularly the areas governing artifacts. Although there is a page dedicated to deleting a package from a NuGet feed, I couldn't get their specification to work. I ended up inspecting the calls made from the UI and copying those, while still using my own token for authentication. This method does the history "trimming" I needed:
public void TrimPackageFeed(string feedName, string packageName)
{
var packageVersions = GetPackageVersions(feedName, packageName);
var deprecated = packageVersions.Where(x => !x.IsLatest && !x.IsDeleted)?.ToList();
if (deprecated != null && deprecated.Any())
{
foreach (var version in deprecated)
{
var url = $"{version.Links.Feed.Value.Replace("feeds.dev.azure.com", "pkgs.dev.azure.com")}/nuget/packagesBatch";
var payload = new AzurePackagePayload
{
Data = null,
Operation = 2,
Packages = new List<AzurePackagePayloadItem>
{
new AzurePackagePayloadItem
{
ID = packageName,
Version = version.Version
}
}
};
ApiRequest(url, Method.POST, null, JsonConvert.SerializeObject(payload));
}
}
}
I built this as a .NET Core 3.1 command line app, published as a self-contained executable within our build repo. I used C# because it's most familiar to me, but I'm confident this could be scripted in any language (probably even just PowerShell). I then appended the following task to the end of my YAML pipeline definition:
- task: CmdLine#2
condition: and(succeeded(), eq(variables['ModifiedProject'], 'true'))
displayName: 'Trim package feed'
inputs:
script: |
AzureApiClient -action trim-package-feed -feed FeedNameHere -package $(ModifiedProject.AssemblyName)
workingDirectory: 'Azure\AzureApiClient\Output'
failOnStderr: true
The package gets pushed to the feed, then the assembly name is passed to my API client which will trim the historical versions and leaves only the new version available to restore.
If you are using a self-hosted agent to run the pipeline, you can try to clear the local nuget cache, delete all the nuget packages in the global nuget cache under C:\Users\xxx\.nuget\packages or use clean nuget caches.
If the package to be consumed is just pushed into the feed, you need to wait for a while . There has to be a delay in populating packages on the feed.
In addition , you can try to use dotnet restore task to see if this issue still occurs . Here is a ticket with similar issue you can refer to .

Snakemake wrappers fails to open environment file: HTTP Error 404: Not Found

When using snakemake wrappers with snakemake version 5.5.2 like this:
rule bcf_to_vcf:
input:
"{prefix}.bcf"
output:
"{prefix}.vcf"
params:
"" # optional parameters for bcftools view (except -o)
wrapper:
"0.38.1/bio/bcftools/view"
I get the following error:
Building DAG of jobs...
WorkflowError:
Failed to open environment file https://bitbucket.org/snakemake/snakemake-wrappers/raw/0.38.1/bio/bcftools/view/environment.yaml:
HTTPError: HTTP Error 404: Not Found
Apparently, the wrapper files are no longer available on bitbucket.
TL/DR:
To use snakemake-wrappers version 0.38.1 and above, you need to use snakemake version 5.7.0 or higher.
What is going on:
Snakemake (and snakemake-wrappers) recently migrated from bitbucket to Github. This causes some minor inconvenience with the paths to the snakemake-wrappers repository used internally by snakemake. The easiest way to solve this is to update snakemake to version 5.7.0 or newer. These version already use the new paths to the Github version.
While the bitbucket repo of snakemake wrappers is still online, it only contains the snakemake-wrapper versions 0.38.0 and lower. To use a higher version of snakemake-wrappers (as 0.38.1 in the code above), you need a newer version of snakemake, which pulls workflow data from the Github version of snakemake-wrappers repo.

Publishing #progress/kendo-ui to nexus 3..5.1 npm pkg repository

We've migrated from Nexus 3.01.01 to 3.5.1-02. In the process we had to migrate internally published npms. One of those is the kendo-ui (commercial one) from Telerik/Progress. We have downloaded the licensed copy from Telerik and publishing it to our local nexus for consumption by our developers.
However the publishing fails with an error during payload parsing. I can publish the same tar without an issue to the older (3.01.01) nexus, so the tar/payload it self is OK.
The error seem to be at the point of trying to parse the npm payload. I can also publish a demo/simple npm (both scoped and non-scoped) without an issue. Spend the whole day trying to figure this out with no luck - appreciate any pointers or advice.
2017-09-06 18:49:09,160+0800 WARN [qtp762281666-4116] MIDALLE
org.sonatype.nexus.repository.httpbridge.internal.ViewServlet -
Failure servicing: PUT /repository/npm-hosted/#progress%2fkendo-ui
java.lang.IllegalStateException: Unexpected token VALUE_NULL at
[Source: java.io.InputStreamReader#1ebad5c7; line: 1, column: 896] at
com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:150)
at
com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseObject(NpmPublishParser.java:174)
at
com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:136)
at
com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseObject(NpmPublishParser.java:174)
at
com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parseValue(NpmPublishParser.java:136)
at
com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parsePackageRoot(NpmPublishParser.java:123)
at
com.sonatype.nexus.repository.npm.internal.NpmPublishParser.parse(NpmPublishParser.java:98)
at
com.sonatype.nexus.repository.npm.internal.NpmRequestParser.parseNpmPublish(NpmRequestParser.java:81)
at
com.sonatype.nexus.repository.npm.internal.NpmRequestParser.parsePublish(NpmRequestParser.java:60)
at
com.sonatype.nexus.repository.npm.internal.NpmHostedFacetImpl.putPackage(NpmHostedFacetImpl.java:85)
at
com.sonatype.nexus.repository.npm.internal.NpmHandlers$3.handle(NpmHandlers.java:172)
at
org.sonatype.nexus.repository.view.Context.proceed(Context.java:80)
Here's the gist for the full error from the nexus log.
This issue was resolved in scope of https://issues.sonatype.org/browse/NEXUS-14385
Fix Version/s:
3.6.1
There was a problem with parsing null values in package.json
I got this to work however I'm still trying to figure out the impact of the change. Please be cautious if you apply the same 'hack' to get this to work. I had to do this, because there was several other project teams that was getting affected.
In a nutshell I had to strip out few keys from the package.json of the kendo-ui package. My analysis is that these settings makes npm issue a network call that fails in our constraint environment.
The package.json keys that I removed are as follows.
First section
"_resolved": "https://registry.npm.telerik.com/#progress%2fkendo-ui/-/kendo-ui-2017.2.621.tgz",
"_shasum": "09a652ead21700716dd5a50f9e86e9bffcea640e",
"_shrinkwrap": null,
Second section
"dist": {
"shasum": "09a652ead21700716dd5a50f9e86e9bffcea640e",
"tarball": "http://registry.npm.telerik.com/#progress%2fkendo-ui/-/kendo-ui-2017.2.621.tgz"
},
I'd really appreciate if someone who know more about npm and npm definitions can inform the purpose of these settings in the package.json and potential impacts of removing them.

bigcommerce-stencil/citadel repo not found

I'm following the installation and setup instructions for stencil found here. Everything seems to have worked correctly until I run the jspm install command. Here is the output:
$ jspm install
Looking up npm:lodash
Updating registry cache...
Looking up github:bigcommerce-stencil/stencil-utils
Looking up github:bigcommerce-stencil/citadel
Looking up github:jspm/nodelibs-url
Looking up github:vakata/jstree
Looking up github:hubspot/pace
warn Using local override for github:hubspot/pace#1.0.2
Looking up github:jackmoore/zoom
Looking up github:browserstate/history.js
Looking up github:asyncly/EventEmitter2
Looking up github:ftlabs/fastclick
Looking up github:kenwheeler/slick
Looking up github:casperin/nod
Looking up github:components/jquery
Looking up github:caolan/async
Looking up github:bigcommerce-labs/foundation
err Repo github:bigcommerce-stencil/citadel not found!
warn Installation changes not saved.
If I run the command again, it looks like the github:bigcommerce-stencil/stencil-utils repo is not found:
$ jspm install
Looking up npm:lodash
Updating registry cache...
Looking up github:bigcommerce-stencil/citadel
Looking up github:bigcommerce-stencil/stencil-utils
Looking up github:jspm/nodelibs-url
Looking up github:casperin/nod
Looking up github:kenwheeler/slick
Looking up github:asyncly/EventEmitter2
Looking up github:vakata/jstree
Looking up github:browserstate/history.js
Looking up github:hubspot/pace
warn Using local override for github:hubspot/pace#1.0.2
Looking up github:bigcommerce-labs/foundation
Looking up github:components/jquery
Looking up github:jackmoore/zoom
Looking up github:ftlabs/fastclick
Looking up github:caolan/async
Downloading npm:lodash#3.10.1
Downloading github:hubspot/pace#1.0.2
Downloading github:jspm/nodelibs-url#0.1.0
Downloading github:casperin/nod#2.0.10
Downloading github:browserstate/history.js#1.8.0
Downloading github:bigcommerce-labs/foundation#5.5.3
Downloading github:vakata/jstree#3.2.1
Downloading github:asyncly/EventEmitter2#0.4.14
Downloading github:jackmoore/zoom#1.7.14
Downloading github:ftlabs/fastclick#1.0.6
Downloading github:kenwheeler/slick#1.5.5
err Repo github:bigcommerce-stencil/stencil-utils not found!
warn Installation changes not saved.
If I run it again, I get the original output. It seems to keep randomly changing. So, the question is, why can't these repos be found?
I know I have access to the repos because if I try to clone it directly, it works fine with the command:
git clone https://github.com/bigcommerce-stencil/citadel.git
Any idea?
The problem that was causing this was the Github Access Token required repo to be checked and not just the subresources associated with repo. Stencil documentation has been updated to reflect this.

How can I upgrade ember-rails' version of ember-data to revision 12?

I've got ember-rails updated to master:
bundle update ember-rails
Updating git://github.com/emberjs/ember-rails.git
Fetching gem metadata from https://rubygems.org/.........
....
Using ember-rails (0.11.1) from git://github.com/emberjs/ember-rails.git (at master)
....
Your bundle is updated!
I'd like to use the latest ember-data revision (12), but every time I update my app's store revision number to 12, i.e.:
App.Store = DS.Store.extend({
revision: 12,
adapter: App.Adapter.create()
});
I see the following error message:
Uncaught Error: Error: The Ember Data library has had breaking API changes since the last time you updated the library. Please review the list of breaking changes at https://github.com/emberjs/data/blob/master/BREAKING_CHANGES.md, then update your store's `revision` property to 11
...and when I check out DS.CURRENT_API_REVISION it's 11:
console.log(DS.CURRENT_API_REVISION); // 11
Is there a way to get the gem to pull in revision 12, or do I have to build ember-data myself and override the included version?
benburton's solution works for what is asked for, but in the latest ember-data it uses an internal method 'readOnly' that was only added to in ember RC2.
Therefore, you need the latest ember in order to run the latest ember-data. The full solution is to simply disregard the second line of your solution, leaving the following:
rails generate ember:install --head
I ended up using ember-rails to generate ember+ember-data and then removing the updated version of Ember like so:
rails generate ember:install --head
rm vendor/assets/ember/development/ember.js vendor/assets/ember/production/ember.js